mirror of
https://github.com/GFDRR/sms-lapli.git
synced 2026-10-27 09:55:57 +00:00
Add the market place application Start Improving the dashboard Edit the data model to make it more suited to the reality of the CNSA Add Support for Alert and notification Add Import-Export functionality Achieve many minor changes to make the application more ergonomic
53 lines
1.5 KiB
Python
53 lines
1.5 KiB
Python
from django.contrib.gis import admin
|
|
|
|
# Register your models here.
|
|
|
|
from base.models import TypeLimite, Limite, Poste, Personne, Observatoire, ObservatoireLimite
|
|
|
|
class ObservatoireLimiteInline(admin.StackedInline):
|
|
model = ObservatoireLimite
|
|
extra = 1
|
|
|
|
|
|
class TypeLimiteAdmin(admin.ModelAdmin):
|
|
list_display = ("nom", "niveau", "description")
|
|
ordering = ['niveau']
|
|
|
|
|
|
class LimiteAdmin(admin.GeoModelAdmin):
|
|
list_display = ("departement", "commune", "section_communale", "typelimite", "nom", "code", )
|
|
list_filter = ('typelimite',)
|
|
search_fields = ["nom", "code"]
|
|
ordering = ['code', 'nom']
|
|
|
|
|
|
class PosteAdmin(admin.ModelAdmin):
|
|
list_display = ("nom_poste", "description")
|
|
|
|
|
|
class PersonneAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"nom", "prenom", "poste", "telephone_bureau", "email",
|
|
"date_embauche", "actif")
|
|
list_filter = ('actif', "date_embauche",)
|
|
search_fields = ["nom", "prenom", "telephone_bureau", "telephone_personnel", "email",
|
|
"adresse", "nif"]
|
|
|
|
|
|
class ObservatoireAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"limite", "nom", "actif")
|
|
list_filter = ('limite', 'actif',)
|
|
search_fields = ["nom"]
|
|
inlines = [ObservatoireLimiteInline]
|
|
|
|
|
|
# Added all in the register
|
|
admin.site.register(Observatoire, ObservatoireAdmin)
|
|
admin.site.register(Poste)
|
|
admin.site.register(Personne, PersonneAdmin)
|
|
admin.site.register(TypeLimite, TypeLimiteAdmin)
|
|
admin.site.register(Limite, LimiteAdmin)
|
|
|
|
|