-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.py
More file actions
33 lines (25 loc) · 992 Bytes
/
admin.py
File metadata and controls
33 lines (25 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from django.contrib import admin
from monitoreo.models import *
# Register your models here.
class SensorAdmin(admin.ModelAdmin):
list_per_page = 25
list_filter = ['estado',]
list_display = ['id', 'url_sensor', 'nombre', 'alias', 'estado']
class PersonaAdmin(admin.ModelAdmin):
list_per_page = 25
#list_filter = ['estado',]
list_display = ['nombre', 'email', 'id_telegram']
class AlertaAdmin(admin.ModelAdmin):
list_per_page = 25
#list_filter = ['estado',]
list_display = ['sensor', 'valor_de_alerta', 'tipo_valor_de_alerta', 'nivel_de_alerta',
'telegram', 'correo', 'sms']
class SensorAlertadoAdmin(admin.ModelAdmin):
list_per_page = 25
#list_filter = ['sensor',]
list_display = ['id', 'alerta', 'fecha', 'activado']
admin.site.register(SensorAlertado, SensorAlertadoAdmin)
admin.site.register(Sensor, SensorAdmin)
#admin.site.register(Intervalo)
admin.site.register(Persona, PersonaAdmin)
admin.site.register(Alerta, AlertaAdmin)