##// END OF EJS Templates
- Agrupando los modelos de la aplicacion en una sola clase.
jsalyrosas -
r120:121
parent child
Show More
@@ -59,7 +59,8
59 # Don't put anything in this directory yourself; store your static files No newline at end of file
59 # Don't put anything in this directory yourself; store your static files
60 # in apps' "static/" subdirectories and in STATICFILES_DIRS. No newline at end of file
60 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
61 # Example: "/home/media/media.lawrence.com/static/"
61 # Example: "/home/media/media.lawrence.com/static/"
No newline at end of file
62 #STATIC_ROOT = os.path.join(PROJECT_DIR, 'static-serve').replace('\\', '/'),
62 STATIC_ROOT = os.path.join(PROJECT_DIR, 'static-serve').replace('\\', '/'), No newline at end of file
No newline at end of file
63 STATIC_ROOT = '' No newline at end of file
63 No newline at end of file
64
64 # URL prefix for static files. No newline at end of file
65 # URL prefix for static files.
65 # Example: "http://media.lawrence.com/static/" No newline at end of file
66 # Example: "http://media.lawrence.com/static/"
@@ -1,3 +1,113
1 from django.db import models No newline at end of file
1 from django.db import models
2 from django.utils import timezone No newline at end of file
2
3
No newline at end of file
4 class profileAntenna(models.Model):
3 # Create your models here. No newline at end of file
No newline at end of file
5
No newline at end of file
6 name = models.CharField(max_length=250)
No newline at end of file
7 date_create = models.DateTimeField()
No newline at end of file
8 date_modified = models.DateTimeField(null=True)
No newline at end of file
9 hits = models.PositiveIntegerField()
No newline at end of file
10 state = models.PositiveSmallIntegerField()
No newline at end of file
11
No newline at end of file
12 class Meta:
No newline at end of file
13 db_table = "abs_profile_antenna"
No newline at end of file
14 verbose_name = "Profile of Configuration"
No newline at end of file
15 verbose_name_plural = "Profiles of Configuration"
No newline at end of file
16
No newline at end of file
17 def save(self):
No newline at end of file
18 if self.pk is None:
No newline at end of file
19 self.date_create = timezone.now()
No newline at end of file
20 self.hits = 0
No newline at end of file
21 self.state = 1
No newline at end of file
22 else:
No newline at end of file
23 self.date_modified = timezone.now()
No newline at end of file
24 super(profileAntenna, self).save()
No newline at end of file
25
No newline at end of file
26 def __unicode__(self):
No newline at end of file
27 return u'%s' % self.value
No newline at end of file
28
No newline at end of file
29 class patternAntenna(models.Model):
No newline at end of file
30
No newline at end of file
31 profile = models.ForeignKey(profileAntenna)
No newline at end of file
32 date_create = models.DateTimeField()
No newline at end of file
33 date_modified = models.DateTimeField(null=True)
No newline at end of file
34 hits = models.PositiveIntegerField()
No newline at end of file
35 state = models.PositiveSmallIntegerField()
No newline at end of file
36
No newline at end of file
37 class Meta:
No newline at end of file
38 db_table = "abs_pattern_antenna"
No newline at end of file
39 verbose_name = "Pattern of Antenna"
No newline at end of file
40 verbose_name_plural = "List of Patterns of Antenna"
No newline at end of file
41
No newline at end of file
42 def save(self):
No newline at end of file
43 if self.pk is None:
No newline at end of file
44 self.date_create = timezone.now()
No newline at end of file
45 self.hits = 0
No newline at end of file
46 self.state = 1
No newline at end of file
47 else:
No newline at end of file
48 self.date_modified = timezone.now()
No newline at end of file
49 super(patternAntenna, self).save()
No newline at end of file
50
No newline at end of file
51 '''
No newline at end of file
52 def __unicode__(self):
No newline at end of file
53 return u'%s' % self.value
No newline at end of file
54 '''
No newline at end of file
55
No newline at end of file
56 class antennaUp(models.Model):
No newline at end of file
57
No newline at end of file
58 pattern = models.ForeignKey(patternAntenna)
No newline at end of file
59 value = models.CharField(max_length=250)
No newline at end of file
60 tx = models.CharField(max_length=250)
No newline at end of file
61 rx = models.CharField(max_length=250)
No newline at end of file
62 ues = models.CharField(max_length=80)
No newline at end of file
63 date_create = models.DateTimeField()
No newline at end of file
64 date_modified = models.DateTimeField(null=True)
No newline at end of file
65 hits = models.PositiveIntegerField()
No newline at end of file
66 state = models.PositiveSmallIntegerField()
No newline at end of file
67
No newline at end of file
68 class Meta:
No newline at end of file
69 db_table = "abs_antenna_up"
No newline at end of file
70 verbose_name = "Antenna Up"
No newline at end of file
71 verbose_name_plural = "List of Antenna Up"
No newline at end of file
72
No newline at end of file
73 def save(self):
No newline at end of file
74 if self.pk is None:
No newline at end of file
75 self.date_create = timezone.now()
No newline at end of file
76 self.hits = 0
No newline at end of file
77 self.state = 1
No newline at end of file
78 else:
No newline at end of file
79 self.date_modified = timezone.now()
No newline at end of file
80 super(antennaUp, self).save()
No newline at end of file
81
No newline at end of file
82 def __unicode__(self):
No newline at end of file
83 return u'%s' % self.value
No newline at end of file
84
No newline at end of file
85
No newline at end of file
86 class antennaDown(models.Model):
No newline at end of file
87
No newline at end of file
88 pattern = models.ForeignKey(patternAntenna)
No newline at end of file
89 value = models.CharField(max_length=250)
No newline at end of file
90 tx = models.CharField(max_length=250)
No newline at end of file
91 rx = models.CharField(max_length=250)
No newline at end of file
92 ues = models.CharField(max_length=80)
No newline at end of file
93 date_create = models.DateTimeField()
No newline at end of file
94 date_modified = models.DateTimeField(null=True)
No newline at end of file
95 hits = models.PositiveIntegerField()
No newline at end of file
96 state = models.PositiveSmallIntegerField()
No newline at end of file
97
No newline at end of file
98 class Meta:
No newline at end of file
99 db_table = "abs_antenna_down"
No newline at end of file
100 verbose_name = "Antenna Down"
No newline at end of file
101 verbose_name_plural = "List of Antenna Down"
No newline at end of file
102
No newline at end of file
103 def save(self):
No newline at end of file
104 if self.pk is None:
No newline at end of file
105 self.date_create = timezone.now()
No newline at end of file
106 self.hits = 0
No newline at end of file
107 self.state = 1
No newline at end of file
108 else:
No newline at end of file
109 self.date_modified = timezone.now()
No newline at end of file
110 super(antennaDown, self).save()
No newline at end of file
111
No newline at end of file
112 def __unicode__(self):
No newline at end of file
113 return u'%s' % self.value No newline at end of file
@@ -3,6 +3,7
3 urlpatterns = patterns('abscontrol.views', No newline at end of file
3 urlpatterns = patterns('abscontrol.views',
4 url(r'^$', 'index'), No newline at end of file
4 url(r'^$', 'index'),
5 url(r'^new/$', 'new'), No newline at end of file
5 url(r'^new/$', 'new'),
6 url(r'^save/$', 'save'), No newline at end of file
6 url(r'^(?P<profile_id>\d+)/$', 'detail'), No newline at end of file
7 url(r'^(?P<profile_id>\d+)/$', 'detail'),
7 #url(r'^(?P<poll_id>\d+)/results/$', 'results'), No newline at end of file
8 #url(r'^(?P<poll_id>\d+)/results/$', 'results'),
8 #url(r'^(?P<poll_id>\d+)/vote/$', 'vote'), No newline at end of file
9 #url(r'^(?P<poll_id>\d+)/vote/$', 'vote'),
@@ -1,5 +1,9
1 from django.shortcuts import render_to_response
1 from django.shortcuts import render_to_response
No newline at end of file
2 from django.http import HttpResponseRedirect
2 from components.profile_antenna.models import profileAntenna No newline at end of file
No newline at end of file
3 from django.core.urlresolvers import reverse
No newline at end of file
4 from django.template import RequestContext
No newline at end of file
5
No newline at end of file
6 from abscontrol.models import profileAntenna, patternAntenna, antennaUp, antennaDown No newline at end of file
3 No newline at end of file
7
4 def index(request): No newline at end of file
8 def index(request):
5 #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] No newline at end of file
9 #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5]
@@ -1,6 +1,35
1 body {
1 body {font-size: 11px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif} No newline at end of file
No newline at end of file
2 font-size: 11px;
No newline at end of file
3 } No newline at end of file
4 article, aside, figure, footer, header, hgroup, nav, section { display:block; }
2 article, aside, figure, footer, header, hgroup, nav, section { display:block; }
No newline at end of file
3 header {border: 1px solid #fcc; font-size: 2em; height: 50px; text-align: center; line-height: 50px}
5 header{border: 1px solid #f00; font-size: 1.2em}
No newline at end of file
No newline at end of file
4 #schema {margin: 0 auto; width: 980px; border: 1px solid #f00; padding: 10px 10px 10px 10px}
6 #schema{margin: 0 auto; width: 980px; border: 1px solid #f00;} No newline at end of file
No newline at end of file
5 #content {border: 1px solid #1cc; margin-top: 5px; margin-bottom: 5px}
No newline at end of file
6 #content #leftcolumn {float: left;border: 1px solid #c55; width: 150px; font-family: Monaco;}
No newline at end of file
7 #content #maincolumn {float: left; border: 1px solid #000; width: 800px; padding-left: 20px;}
No newline at end of file
8 footer {border: 1px solid #200; font-size: 0.9em; height: 30px; text-align: center; line-height: 20px}
No newline at end of file
9
No newline at end of file
10 .cleardivs {clear: both; border: 1px solid #400; height: 0px}
No newline at end of file
11
No newline at end of file
12
No newline at end of file
13 /****************************************************************************************/
No newline at end of file
14 /****** MENU DE NAVEGACION DE PERFILES **********************************/
No newline at end of file
15 /****************************************************************************************/
No newline at end of file
16 #content #infoProfiles {border: 1px solid #d00; width: 140px; margin: 0px; padding-top: 2px; padding-bottom: 2px}
No newline at end of file
17 .lblInfo {padding-left: 12px; line-height: 20px;}
No newline at end of file
18 #content nav {border: 1px solid #c55; width: 140px; margin: 0px; font-family: Monaco; font-size: 1.2em;}
No newline at end of file
19 #content nav ul{list-style: none; list-style-type: none; margin: 15px 15px 15px 15px; padding-left: 20px; border: 0px solid #eee}
No newline at end of file
20 #content nav ul li{line-height: 20px}
No newline at end of file
21
No newline at end of file
22 /****************************************************************************************/
No newline at end of file
23 /******** FORMULARIO DE PERFILES *************************************/
No newline at end of file
24 /****************************************************************************************/
No newline at end of file
25 #divProfile {border: 0px solid #dff; margin: 10px 0px; padding: 10px 10px; width: 500px}
No newline at end of file
26 .flsAntenna {margin: 10px 0px; width: 750px; padding: 10px 10px}
No newline at end of file
27 #divPattern textarea,input[type=text],label {font-family: Monaco; font-size: inherit;}
No newline at end of file
28 #divPattern input[type=text] {width: 200px}
No newline at end of file
29 #divPattern textarea {resize: none; overflow: hidden}
No newline at end of file
30 .divAntenna {float: left; margin: 10px; height: 150px}
No newline at end of file
31 .divAntenna label {display: block}
No newline at end of file
32 .divTx {display: block; float: left; margin: 10px; height: 150px}
No newline at end of file
33 .divTx label {display: block}
No newline at end of file
34 .divUes {display: block; margin: 10px}
No newline at end of file
35 .txtAntenna {max-width: 200px; max-height: 120px} No newline at end of file
@@ -3,24 +3,28
3 {% block title %}ABS CONTROL:::::{% endblock %} No newline at end of file
3 {% block title %}ABS CONTROL:::::{% endblock %}
4 No newline at end of file
4
5 {% block content %} No newline at end of file
5 {% block content %}
6 <div id="content">
No newline at end of file
7 {% block leftcolumn %} No newline at end of file
6 <div id="leftcolumn">
8 <div id="leftcolumn">
No newline at end of file
9 <div id="lsProfiles">
7 <div> No newline at end of file
No newline at end of file
10 <div id="infoProfiles">
No newline at end of file
11 <label for="lblProfile" class="lblInfo">Profiles:</label><br /> No newline at end of file
8 {% if profile_list %}
12 {% if profile_list %}
No newline at end of file
13 <select name="lsProfiles">
9 <ul>
No newline at end of file
No newline at end of file
14 <option>Choose ...</option> No newline at end of file
10 <li><a href="#">Choose ...</</a></li> No newline at end of file
11 {% for entry in profile_list %}
15 {% for entry in profile_list %}
No newline at end of file
16 <option value="{{ entry.id }}">{{ entry.name }}</option> No newline at end of file
12 <li><a href="/view/{{ entry.id }}">{{ entry.name }}</a></li> No newline at end of file
13 {% endfor %}
17 {% endfor %}
No newline at end of file
18 </select> No newline at end of file
14 </ul> No newline at end of file
15 {% else %}
19 {% else %}
No newline at end of file
20 <label for="lblMessage" class="lblInfo">No profiles.</label> No newline at end of file
16 <p>No profiles are available.</p> No newline at end of file
17 {% endif %} No newline at end of file
21 {% endif %}
22 </div> No newline at end of file
18 </div> No newline at end of file
23 </div>
19 {% block mnu_profile %} No newline at end of file
24 {% block mnu_profile %}
20 <nav> No newline at end of file
25 <nav>
21 <ul>
26 <ul>
No newline at end of file
27 <li><a href="/abscontrol/new">New</a></li> No newline at end of file
22 <li><a href="new">New</a></li>
No newline at end of file
23 <li><a href="#">Save</a></li> No newline at end of file
24 <li><a href="#">Save as</a></li> No newline at end of file
28 <li><a href="#">Save as</a></li>
25 <li><a href="#">Import</a></li> No newline at end of file
29 <li><a href="#">Import</a></li>
26 <li><a href="#">Export</a></li> No newline at end of file
30 <li><a href="#">Export</a></li>
@@ -3,11 +3,58
3 No newline at end of file
3
4 {% block maincolumn%} No newline at end of file
4 {% block maincolumn%}
5 <div id="maincolumn">
5 <div id="maincolumn">
No newline at end of file
6 <form action="/abscontrol/save/" method="post">
6 <form action="/save/" method="post">
No newline at end of file
No newline at end of file
7 <div id="divProfile">
7 {% csrf_token %}
No newline at end of file
No newline at end of file
8 <label for="lblName">Profile:</label>
8 <label for="lblName">Profile:</label><br />
No newline at end of file
No newline at end of file
9 <input type="text" name="txtProfile" id="" value="" /> No newline at end of file
9 <input type="text" name="profile" id="" value="" /> No newline at end of file
10 <input type="submit" value="Save" /> No newline at end of file
10 <input type="submit" value="Save" />
11 </div>
No newline at end of file
12 <div id="divPattern">
No newline at end of file
13 <div id="antennaUp">
No newline at end of file
14 <fieldset class="flsAntenna">
No newline at end of file
15 <legend>UP</legend>
No newline at end of file
16 <div class="divAntenna">
No newline at end of file
17 <label for="lblAntenna">Antenna</label>
No newline at end of file
18 <textarea name="txtAntennaUp" class="txtAntenna" cols="38" rows="8"></textarea>
No newline at end of file
19 </div>
No newline at end of file
20 <div class="divTx">
No newline at end of file
21 <label for="lblTx">Tx</label>
No newline at end of file
22 <textarea name="txtTxUp" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
23 </div>
No newline at end of file
24 <div class="divTx">
No newline at end of file
25 <label for="lblRx">Rx</label>
No newline at end of file
26 <textarea name="txtRxUp" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
27 </div>
No newline at end of file
28 <div class="cleardivs"></div>
No newline at end of file
29 <div class="divUes">
No newline at end of file
30 <label for="lblUes">Ues:</label>
No newline at end of file
31 <input type="text" name="txtUesUp" value="" />
No newline at end of file
32 </div>
No newline at end of file
33 </fieldset>
No newline at end of file
34 </div>
No newline at end of file
35 <div id="antennaDown">
No newline at end of file
36 <fieldset class="flsAntenna">
No newline at end of file
37 <legend>DOWN</legend>
No newline at end of file
38 <div class="divAntenna">
No newline at end of file
39 <label for="lblAntenna">Antenna</label>
No newline at end of file
40 <textarea name="txtAntennaDown" class="txtAntenna" cols="38" rows="8"></textarea>
No newline at end of file
41 </div>
No newline at end of file
42 <div class="divTx">
No newline at end of file
43 <label for="lblTx">Tx</label>
No newline at end of file
44 <textarea name="txtTxDown" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
45 </div>
No newline at end of file
46 <div class="divTx">
No newline at end of file
47 <label for="lblRx">Rx</label>
No newline at end of file
48 <textarea name="txtRxDown" class="txtTR" cols="20" rows="8"></textarea>
No newline at end of file
49 </div>
No newline at end of file
50 <div class="cleardivs"></div>
No newline at end of file
51 <div class="divUes">
No newline at end of file
52 <label for="lblUes">Ues:</label>
No newline at end of file
53 <input type="text" name="txtUesDown" value="" />
No newline at end of file
54 </div>
No newline at end of file
55 </fieldset>
No newline at end of file
56 </div>
No newline at end of file
57 </div> No newline at end of file
11 </form> No newline at end of file
58 </form>
12 </div> No newline at end of file
59 </div>
13 {% endblock %} No newline at end of file
60 {% endblock %}
@@ -1,3 +1,4
1 {% load static %} No newline at end of file
1 <!DOCTYPE html> No newline at end of file
2 <!DOCTYPE html>
2 <html lang="en"> No newline at end of file
3 <html lang="en">
3 <head> No newline at end of file
4 <head>
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now