##// END OF EJS Templates
- Habilitada la seccion admin de la aplicacion.
jsalyrosas -
r143:144
parent child
Show More
@@ -0,0 +1,33
1 from abscontrol.models import Profile, Pattern, AntennaUp, AntennaDown
No newline at end of file
2 from django.contrib import admin
No newline at end of file
3
No newline at end of file
4 class AntennaUpInline(admin.StackedInline):
No newline at end of file
5 model = AntennaUp
No newline at end of file
6
No newline at end of file
7 class AntennaDownInline(admin.StackedInline):
No newline at end of file
8 model = AntennaDown
No newline at end of file
9
No newline at end of file
10 class PatternAdmin(admin.ModelAdmin):
No newline at end of file
11 fieldsets = [
No newline at end of file
12 (None, {'fields': ['value']}),
No newline at end of file
13 ('Date information', {'fields': ['date_create', 'date_modified'], 'classes': ['collapse']}),
No newline at end of file
14 ]
No newline at end of file
15 inlines = [AntennaUpInline]
No newline at end of file
16 inlines = [AntennaDownInline]
No newline at end of file
17
No newline at end of file
18 class PatternInline(admin.StackedInline):
No newline at end of file
19 model = Pattern
No newline at end of file
20 extra = 0
No newline at end of file
21
No newline at end of file
22 class ProfileAdmin(admin.ModelAdmin):
No newline at end of file
23 fieldsets = [
No newline at end of file
24 (None, {'fields': ['name']}),
No newline at end of file
25 ('Date information', {'fields': ['date_create', 'date_modified'], 'classes': ['collapse']}),
No newline at end of file
26 ]
No newline at end of file
27 inlines = [PatternInline]
No newline at end of file
28
No newline at end of file
29
No newline at end of file
30 admin.site.register(Profile, ProfileAdmin)
No newline at end of file
31 admin.site.register(Pattern, PatternAdmin)
No newline at end of file
32 admin.site.register(AntennaUp)
No newline at end of file
33 admin.site.register(AntennaDown) No newline at end of file
@@ -1,159 +1,159
1 # Django settings for abs_webapp_dev project. No newline at end of file
1 # Django settings for abs_webapp_dev project.
2 No newline at end of file
2
3 import os No newline at end of file
3 import os
4 PROJECT_DIR = os.path.split(os.path.dirname(__file__))[0] No newline at end of file
4 PROJECT_DIR = os.path.split(os.path.dirname(__file__))[0]
5 No newline at end of file
5
6 DEBUG = True No newline at end of file
6 DEBUG = True
7 TEMPLATE_DEBUG = DEBUG No newline at end of file
7 TEMPLATE_DEBUG = DEBUG
8 No newline at end of file
8
9 ADMINS = ( No newline at end of file
9 ADMINS = (
10 # ('Your Name', 'your_email@example.com'), No newline at end of file
10 # ('Your Name', 'your_email@example.com'),
11 ) No newline at end of file
11 )
12 No newline at end of file
12
13 MANAGERS = ADMINS No newline at end of file
13 MANAGERS = ADMINS
14 No newline at end of file
14
15 DATABASES = { No newline at end of file
15 DATABASES = {
16 'default': { No newline at end of file
16 'default': {
17 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. No newline at end of file
17 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
18 'NAME': 'db_jrowebapp_dev', # Or path to database file if using sqlite3. No newline at end of file
18 'NAME': 'db_jrowebapp_dev', # Or path to database file if using sqlite3.
19 'USER': 'abscontrol', # Not used with sqlite3. No newline at end of file
19 'USER': 'abscontrol', # Not used with sqlite3.
20 'PASSWORD': 'abscontrol', # Not used with sqlite3. No newline at end of file
20 'PASSWORD': 'abscontrol', # Not used with sqlite3.
21 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3. No newline at end of file
21 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
22 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. No newline at end of file
22 'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
23 } No newline at end of file
23 }
24 } No newline at end of file
24 }
25 No newline at end of file
25
26 # Local time zone for this installation. Choices can be found here: No newline at end of file
26 # Local time zone for this installation. Choices can be found here:
27 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name No newline at end of file
27 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
28 # although not all choices may be available on all operating systems. No newline at end of file
28 # although not all choices may be available on all operating systems.
29 # In a Windows environment this must be set to your system time zone. No newline at end of file
29 # In a Windows environment this must be set to your system time zone.
30 TIME_ZONE = 'America/Lima' No newline at end of file
30 TIME_ZONE = 'America/Lima'
31 No newline at end of file
31
32 # Language code for this installation. All choices can be found here: No newline at end of file
32 # Language code for this installation. All choices can be found here:
33 # http://www.i18nguy.com/unicode/language-identifiers.html No newline at end of file
33 # http://www.i18nguy.com/unicode/language-identifiers.html
34 LANGUAGE_CODE = 'en-us' No newline at end of file
34 LANGUAGE_CODE = 'en-us'
35 No newline at end of file
35
36 SITE_ID = 1 No newline at end of file
36 SITE_ID = 1
37 No newline at end of file
37
38 # If you set this to False, Django will make some optimizations so as not No newline at end of file
38 # If you set this to False, Django will make some optimizations so as not
39 # to load the internationalization machinery. No newline at end of file
39 # to load the internationalization machinery.
40 USE_I18N = True No newline at end of file
40 USE_I18N = True
41 No newline at end of file
41
42 # If you set this to False, Django will not format dates, numbers and No newline at end of file
42 # If you set this to False, Django will not format dates, numbers and
43 # calendars according to the current locale. No newline at end of file
43 # calendars according to the current locale.
44 USE_L10N = True No newline at end of file
44 USE_L10N = True
45 No newline at end of file
45
46 # If you set this to False, Django will not use timezone-aware datetimes. No newline at end of file
46 # If you set this to False, Django will not use timezone-aware datetimes.
47 USE_TZ = True No newline at end of file
47 USE_TZ = True
48 No newline at end of file
48
49 # Absolute filesystem path to the directory that will hold user-uploaded files. No newline at end of file
49 # Absolute filesystem path to the directory that will hold user-uploaded files.
50 # Example: "/home/media/media.lawrence.com/media/" No newline at end of file
50 # Example: "/home/media/media.lawrence.com/media/"
51 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media').replace('\\', '/') No newline at end of file
51 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media').replace('\\', '/')
52 No newline at end of file
52
53 # URL that handles the media served from MEDIA_ROOT. Make sure to use a No newline at end of file
53 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
54 # trailing slash. No newline at end of file
54 # trailing slash.
55 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" No newline at end of file
55 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
56 MEDIA_URL = '/media/' No newline at end of file
56 MEDIA_URL = '/media/'
57 No newline at end of file
57
58 # Absolute path to the directory static files should be collected to. No newline at end of file
58 # Absolute path to the directory static files should be collected to.
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/" No newline at end of file
61 # Example: "/home/media/media.lawrence.com/static/"
62 #STATIC_ROOT = os.path.join(PROJECT_DIR, 'static-serve').replace('\\', '/'), No newline at end of file
62 #STATIC_ROOT = os.path.join(PROJECT_DIR, 'static-serve').replace('\\', '/'),
63 STATIC_ROOT = '' No newline at end of file
63 STATIC_ROOT = ''
64 No newline at end of file
64
65 # URL prefix for static files. No newline at end of file
65 # URL prefix for static files.
66 # Example: "http://media.lawrence.com/static/" No newline at end of file
66 # Example: "http://media.lawrence.com/static/"
67 STATIC_URL = '/static/' No newline at end of file
67 STATIC_URL = '/static/'
68 No newline at end of file
68
69 # Additional locations of static files No newline at end of file
69 # Additional locations of static files
70 STATICFILES_DIRS = ( No newline at end of file
70 STATICFILES_DIRS = (
71 # Put strings here, like "/home/html/static" or "C:/www/django/static". No newline at end of file
71 # Put strings here, like "/home/html/static" or "C:/www/django/static".
72 # Always use forward slashes, even on Windows. No newline at end of file
72 # Always use forward slashes, even on Windows.
73 # Don't forget to use absolute paths, not relative paths. No newline at end of file
73 # Don't forget to use absolute paths, not relative paths.
74 #os.path.join(PROJECT_DIR, "static").replace('\\', '/'), No newline at end of file
74 #os.path.join(PROJECT_DIR, "static").replace('\\', '/'),
75 ("static", os.path.join(PROJECT_DIR, "static").replace('\\', '/')), No newline at end of file
75 ("static", os.path.join(PROJECT_DIR, "static").replace('\\', '/')),
76 ) No newline at end of file
76 )
77 No newline at end of file
77
78 # List of finder classes that know how to find static files in No newline at end of file
78 # List of finder classes that know how to find static files in
79 # various locations. No newline at end of file
79 # various locations.
80 STATICFILES_FINDERS = ( No newline at end of file
80 STATICFILES_FINDERS = (
81 'django.contrib.staticfiles.finders.FileSystemFinder', No newline at end of file
81 'django.contrib.staticfiles.finders.FileSystemFinder',
82 'django.contrib.staticfiles.finders.AppDirectoriesFinder', No newline at end of file
82 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
83 # 'django.contrib.staticfiles.finders.DefaultStorageFinder', No newline at end of file
83 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
84 ) No newline at end of file
84 )
85 No newline at end of file
85
86 # Make this unique, and don't share it with anybody. No newline at end of file
86 # Make this unique, and don't share it with anybody.
87 SECRET_KEY = '=^abu)gd=)7hf#rme_vw=tv!bdh7+tts*^&)h(n=7@7(9#__@e' No newline at end of file
87 SECRET_KEY = '=^abu)gd=)7hf#rme_vw=tv!bdh7+tts*^&)h(n=7@7(9#__@e'
88 No newline at end of file
88
89 # List of callables that know how to import templates from various sources. No newline at end of file
89 # List of callables that know how to import templates from various sources.
90 TEMPLATE_LOADERS = ( No newline at end of file
90 TEMPLATE_LOADERS = (
91 'django.template.loaders.filesystem.Loader', No newline at end of file
91 'django.template.loaders.filesystem.Loader',
92 'django.template.loaders.app_directories.Loader', No newline at end of file
92 'django.template.loaders.app_directories.Loader',
93 # 'django.template.loaders.eggs.Loader', No newline at end of file
93 # 'django.template.loaders.eggs.Loader',
94 ) No newline at end of file
94 )
95 No newline at end of file
95
96 MIDDLEWARE_CLASSES = ( No newline at end of file
96 MIDDLEWARE_CLASSES = (
97 'django.middleware.common.CommonMiddleware', No newline at end of file
97 'django.middleware.common.CommonMiddleware',
98 'django.contrib.sessions.middleware.SessionMiddleware', No newline at end of file
98 'django.contrib.sessions.middleware.SessionMiddleware',
99 #'django.middleware.csrf.CsrfViewMiddleware', No newline at end of file
99 #'django.middleware.csrf.CsrfViewMiddleware',
100 'django.contrib.auth.middleware.AuthenticationMiddleware', No newline at end of file
100 'django.contrib.auth.middleware.AuthenticationMiddleware',
101 'django.contrib.messages.middleware.MessageMiddleware', No newline at end of file
101 'django.contrib.messages.middleware.MessageMiddleware',
102 # Uncomment the next line for simple clickjacking protection: No newline at end of file
102 # Uncomment the next line for simple clickjacking protection:
103 # 'django.middleware.clickjacking.XFrameOptionsMiddleware', No newline at end of file
103 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
104 ) No newline at end of file
104 )
105 No newline at end of file
105
106 ROOT_URLCONF = 'abs_webapp_dev.urls' No newline at end of file
106 ROOT_URLCONF = 'abs_webapp_dev.urls'
107 No newline at end of file
107
108 # Python dotted path to the WSGI application used by Django's runserver. No newline at end of file
108 # Python dotted path to the WSGI application used by Django's runserver.
109 WSGI_APPLICATION = 'abs_webapp_dev.wsgi.application' No newline at end of file
109 WSGI_APPLICATION = 'abs_webapp_dev.wsgi.application'
110 No newline at end of file
110
111 TEMPLATE_DIRS = ( No newline at end of file
111 TEMPLATE_DIRS = (
112 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". No newline at end of file
112 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
113 # Always use forward slashes, even on Windows. No newline at end of file
113 # Always use forward slashes, even on Windows.
114 # Don't forget to use absolute paths, not relative paths. No newline at end of file
114 # Don't forget to use absolute paths, not relative paths.
115 os.path.join(PROJECT_DIR, "templates").replace('\\', '/'), No newline at end of file
115 os.path.join(PROJECT_DIR, "templates").replace('\\', '/'),
116 ) No newline at end of file
116 )
117 No newline at end of file
117
118 INSTALLED_APPS = ( No newline at end of file
118 INSTALLED_APPS = (
119 'django.contrib.auth', No newline at end of file
119 'django.contrib.auth',
120 'django.contrib.contenttypes', No newline at end of file
120 'django.contrib.contenttypes',
121 'django.contrib.sessions', No newline at end of file
121 'django.contrib.sessions',
122 'django.contrib.sites', No newline at end of file
122 'django.contrib.sites',
123 'django.contrib.messages', No newline at end of file
123 'django.contrib.messages',
124 'django.contrib.staticfiles', No newline at end of file
124 'django.contrib.staticfiles',
125 # Uncomment the next line to enable the admin:
125 # Uncomment the next line to enable the admin:
No newline at end of file
126 'django.contrib.admin', No newline at end of file
126 # 'django.contrib.admin', No newline at end of file
127 # Uncomment the next line to enable admin documentation: No newline at end of file
127 # Uncomment the next line to enable admin documentation:
128 # 'django.contrib.admindocs', No newline at end of file
128 # 'django.contrib.admindocs',
129 'abscontrol', No newline at end of file
129 'abscontrol',
130 ) No newline at end of file
130 )
131 No newline at end of file
131
132 # A sample logging configuration. The only tangible logging No newline at end of file
132 # A sample logging configuration. The only tangible logging
133 # performed by this configuration is to send an email to No newline at end of file
133 # performed by this configuration is to send an email to
134 # the site admins on every HTTP 500 error when DEBUG=False. No newline at end of file
134 # the site admins on every HTTP 500 error when DEBUG=False.
135 # See http://docs.djangoproject.com/en/dev/topics/logging for No newline at end of file
135 # See http://docs.djangoproject.com/en/dev/topics/logging for
136 # more details on how to customize your logging configuration. No newline at end of file
136 # more details on how to customize your logging configuration.
137 LOGGING = { No newline at end of file
137 LOGGING = {
138 'version': 1, No newline at end of file
138 'version': 1,
139 'disable_existing_loggers': False, No newline at end of file
139 'disable_existing_loggers': False,
140 'filters': { No newline at end of file
140 'filters': {
141 'require_debug_false': { No newline at end of file
141 'require_debug_false': {
142 '()': 'django.utils.log.RequireDebugFalse' No newline at end of file
142 '()': 'django.utils.log.RequireDebugFalse'
143 } No newline at end of file
143 }
144 }, No newline at end of file
144 },
145 'handlers': { No newline at end of file
145 'handlers': {
146 'mail_admins': { No newline at end of file
146 'mail_admins': {
147 'level': 'ERROR', No newline at end of file
147 'level': 'ERROR',
148 'filters': ['require_debug_false'], No newline at end of file
148 'filters': ['require_debug_false'],
149 'class': 'django.utils.log.AdminEmailHandler' No newline at end of file
149 'class': 'django.utils.log.AdminEmailHandler'
150 } No newline at end of file
150 }
151 }, No newline at end of file
151 },
152 'loggers': { No newline at end of file
152 'loggers': {
153 'django.request': { No newline at end of file
153 'django.request': {
154 'handlers': ['mail_admins'], No newline at end of file
154 'handlers': ['mail_admins'],
155 'level': 'ERROR', No newline at end of file
155 'level': 'ERROR',
156 'propagate': True, No newline at end of file
156 'propagate': True,
157 }, No newline at end of file
157 },
158 } No newline at end of file
158 }
159 } No newline at end of file
159 }
@@ -1,18 +1,18
1 from django.conf.urls import patterns, include, url No newline at end of file
1 from django.conf.urls import patterns, include, url
2 No newline at end of file
2
3 # Uncomment the next two lines to enable the admin:
3 # Uncomment the next two lines to enable the admin:
No newline at end of file
4 from django.contrib import admin
4 # from django.contrib import admin
No newline at end of file
No newline at end of file
5 admin.autodiscover() No newline at end of file
5 # admin.autodiscover() No newline at end of file
6 No newline at end of file
6
7 urlpatterns = patterns('', No newline at end of file
7 urlpatterns = patterns('',
8 # Examples: No newline at end of file
8 # Examples:
9 # url(r'^$', 'abs_webapp_dev.views.home', name='home'), No newline at end of file
9 # url(r'^$', 'abs_webapp_dev.views.home', name='home'),
10 # url(r'^abs_webapp_dev/', include('abs_webapp_dev.foo.urls')), No newline at end of file
10 # url(r'^abs_webapp_dev/', include('abs_webapp_dev.foo.urls')),
11 No newline at end of file
11
12 # Uncomment the admin/doc line below to enable admin documentation: No newline at end of file
12 # Uncomment the admin/doc line below to enable admin documentation:
13 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), No newline at end of file
13 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
14 No newline at end of file
14
15 # Uncomment the next line to enable the admin:
15 # Uncomment the next line to enable the admin:
No newline at end of file
16 url(r'^admin/', include(admin.site.urls)), No newline at end of file
16 # url(r'^admin/', include(admin.site.urls)), No newline at end of file
17 url(r'^abscontrol/', include('abscontrol.urls')), No newline at end of file
17 url(r'^abscontrol/', include('abscontrol.urls')),
18 ) No newline at end of file
18 )
@@ -1,106 +1,105
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 from django.utils import timezone
3 No newline at end of file
3
4 class Profile(models.Model): No newline at end of file
4 class Profile(models.Model):
5 No newline at end of file
5
6 name = models.CharField(max_length=250) No newline at end of file
6 name = models.CharField(max_length=250)
7 date_create = models.DateTimeField() No newline at end of file
7 date_create = models.DateTimeField()
8 date_modified = models.DateTimeField(null=True) No newline at end of file
8 date_modified = models.DateTimeField(null=True)
9 hits = models.PositiveIntegerField() No newline at end of file
9 hits = models.PositiveIntegerField()
10 state = models.PositiveSmallIntegerField() No newline at end of file
10 state = models.PositiveSmallIntegerField()
11 No newline at end of file
11
12 class Meta: No newline at end of file
12 class Meta:
13 db_table = "abs_profile_antenna" No newline at end of file
13 db_table = "abs_profile_antenna"
14 No newline at end of file
14
15 def save(self): No newline at end of file
15 def save(self):
16 if self.pk is None: No newline at end of file
16 if self.pk is None:
17 self.date_create = timezone.now() No newline at end of file
17 self.date_create = timezone.now()
18 self.hits = 0 No newline at end of file
18 self.hits = 0
19 self.state = 1 No newline at end of file
19 self.state = 1
20 else: No newline at end of file
20 else:
21 self.date_modified = timezone.now() No newline at end of file
21 self.date_modified = timezone.now()
22 super(Profile, self).save() No newline at end of file
22 super(Profile, self).save()
23 No newline at end of file
23
24 def __unicode__(self): No newline at end of file
24 def __unicode__(self):
25 return u'%s' % self.name No newline at end of file
25 return u'%s' % self.name
26 No newline at end of file
26
27 class Pattern(models.Model): No newline at end of file
27 class Pattern(models.Model):
28 No newline at end of file
28
29 profile = models.ForeignKey(Profile) No newline at end of file
29 profile = models.ForeignKey(Profile)
30 value = models.PositiveIntegerField() No newline at end of file
30 value = models.PositiveIntegerField()
31 date_create = models.DateTimeField() No newline at end of file
31 date_create = models.DateTimeField()
32 date_modified = models.DateTimeField(null=True) No newline at end of file
32 date_modified = models.DateTimeField(null=True)
33 hits = models.PositiveIntegerField() No newline at end of file
33 hits = models.PositiveIntegerField()
34 state = models.PositiveSmallIntegerField() No newline at end of file
34 state = models.PositiveSmallIntegerField()
35 No newline at end of file
35
36 class Meta: No newline at end of file
36 class Meta:
37 db_table = "abs_pattern_antenna" No newline at end of file
37 db_table = "abs_pattern_antenna"
38 No newline at end of file
38
39 def save(self, *args, **kwargs): No newline at end of file
39 def save(self, *args, **kwargs):
40 if not self.pk: No newline at end of file
40 if not self.pk:
41 self.date_create = timezone.now() No newline at end of file
41 self.date_create = timezone.now()
42 self.hits = 0 No newline at end of file
42 self.hits = 0
43 self.state = 1 No newline at end of file
43 self.state = 1
44 else: No newline at end of file
44 else:
45 self.date_modified = timezone.now() No newline at end of file
45 self.date_modified = timezone.now()
46 super(Pattern, self).save(*args, **kwargs) No newline at end of file
46 super(Pattern, self).save(*args, **kwargs)
47
47
No newline at end of file
48 ''' No newline at end of file
49 def __unicode__(self): No newline at end of file
48 def __unicode__(self):
50 return u'%s' % self.value
49 return u'%s' % self.value
No newline at end of file
50 No newline at end of file
51 ''' No newline at end of file
52 No newline at end of file
51
53 class AntennaUp(models.Model): No newline at end of file
52 class AntennaUp(models.Model):
54 No newline at end of file
53
55 pattern = models.ForeignKey(Pattern) No newline at end of file
54 pattern = models.ForeignKey(Pattern)
56 value = models.TextField() No newline at end of file
55 value = models.TextField()
57 tx = models.TextField() No newline at end of file
56 tx = models.TextField()
58 rx = models.TextField() No newline at end of file
57 rx = models.TextField()
59 ues = models.CharField(max_length=120) No newline at end of file
58 ues = models.CharField(max_length=120)
60 date_create = models.DateTimeField() No newline at end of file
59 date_create = models.DateTimeField()
61 date_modified = models.DateTimeField(null=True) No newline at end of file
60 date_modified = models.DateTimeField(null=True)
62 hits = models.PositiveIntegerField() No newline at end of file
61 hits = models.PositiveIntegerField()
63 state = models.PositiveSmallIntegerField() No newline at end of file
62 state = models.PositiveSmallIntegerField()
64 No newline at end of file
63
65 class Meta: No newline at end of file
64 class Meta:
66 db_table = "abs_antenna_up" No newline at end of file
65 db_table = "abs_antenna_up"
67 No newline at end of file
66
68 def save(self, *args, **kwargs): No newline at end of file
67 def save(self, *args, **kwargs):
69 if self.pk is None: No newline at end of file
68 if self.pk is None:
70 self.date_create = timezone.now() No newline at end of file
69 self.date_create = timezone.now()
71 self.hits = 0 No newline at end of file
70 self.hits = 0
72 self.state = 1 No newline at end of file
71 self.state = 1
73 else: No newline at end of file
72 else:
74 self.date_modified = timezone.now() No newline at end of file
73 self.date_modified = timezone.now()
75 super(AntennaUp, self).save(*args, **kwargs) No newline at end of file
74 super(AntennaUp, self).save(*args, **kwargs)
76 No newline at end of file
75
77 def __unicode__(self): No newline at end of file
76 def __unicode__(self):
78 return u'%s' % self.value No newline at end of file
77 return u'%s' % self.value
79 No newline at end of file
78
80 No newline at end of file
79
81 class AntennaDown(models.Model): No newline at end of file
80 class AntennaDown(models.Model):
82 No newline at end of file
81
83 pattern = models.ForeignKey(Pattern) No newline at end of file
82 pattern = models.ForeignKey(Pattern)
84 value = models.TextField() No newline at end of file
83 value = models.TextField()
85 tx = models.TextField() No newline at end of file
84 tx = models.TextField()
86 rx = models.TextField() No newline at end of file
85 rx = models.TextField()
87 ues = models.CharField(max_length=120) No newline at end of file
86 ues = models.CharField(max_length=120)
88 date_create = models.DateTimeField() No newline at end of file
87 date_create = models.DateTimeField()
89 date_modified = models.DateTimeField(null=True) No newline at end of file
88 date_modified = models.DateTimeField(null=True)
90 hits = models.PositiveIntegerField() No newline at end of file
89 hits = models.PositiveIntegerField()
91 state = models.PositiveSmallIntegerField() No newline at end of file
90 state = models.PositiveSmallIntegerField()
92 No newline at end of file
91
93 class Meta: No newline at end of file
92 class Meta:
94 db_table = "abs_antenna_down" No newline at end of file
93 db_table = "abs_antenna_down"
95 No newline at end of file
94
96 def save(self, *args, **kwargs): No newline at end of file
95 def save(self, *args, **kwargs):
97 if self.pk is None: No newline at end of file
96 if self.pk is None:
98 self.date_create = timezone.now() No newline at end of file
97 self.date_create = timezone.now()
99 self.hits = 0 No newline at end of file
98 self.hits = 0
100 self.state = 1 No newline at end of file
99 self.state = 1
101 else: No newline at end of file
100 else:
102 self.date_modified = timezone.now() No newline at end of file
101 self.date_modified = timezone.now()
103 super(AntennaDown, self).save(*args, **kwargs) No newline at end of file
102 super(AntennaDown, self).save(*args, **kwargs)
104 No newline at end of file
103
105 def __unicode__(self): No newline at end of file
104 def __unicode__(self):
106 return u'%s' % self.value No newline at end of file
105 return u'%s' % self.value
General Comments 0
You need to be logged in to leave comments. Login now