Browse Source

Mais autocomplete fields

pull/159/head 3.0.15
Sesostris Vieira 2 years ago
parent
commit
e521cb12cc
  1. 8
      sigi/apps/contatos/admin.py
  2. 3
      sigi/apps/eventos/admin.py

8
sigi/apps/contatos/admin.py

@ -25,6 +25,7 @@ class MicrorregiaoInline(admin.TabularInline):
class SenadorInline(admin.StackedInline):
model = Senador
extra = 0
autocomplete_fields = ("partido",)
@admin.register(UnidadeFederativa)
@ -53,10 +54,16 @@ class MesorregiaoAdmin(admin.ModelAdmin):
"codigo_ibge",
"uf__sigla",
)
autocomplete_fields = ("uf",)
get_queryset = queryset_ascii
inlines = (MicrorregiaoInline,)
@admin.register(Microrregiao)
class MicrorregiaoAdmin(admin.ModelAdmin):
search_fields = ("search_text",)
@admin.register(Municipio)
class MunicipioAdmin(admin.ModelAdmin):
actions = None
@ -111,6 +118,7 @@ class MunicipioAdmin(admin.ModelAdmin):
},
),
)
autocomplete_fields = ("uf", "microrregiao")
search_fields = ("search_text", "codigo_ibge", "codigo_tse", "uf__sigla")

3
sigi/apps/eventos/admin.py

@ -88,6 +88,7 @@ class ChecklistInline(admin.StackedInline):
class EquipeInline(admin.StackedInline):
model = Equipe
autocomplete_fields = ("membro", "funcao")
class ConviteInline(admin.StackedInline):
@ -97,6 +98,7 @@ class ConviteInline(admin.StackedInline):
class ModuloInline(admin.StackedInline):
model = Modulo
autocomplete_fields = ("apresentador", "monitor")
class AnexoInline(admin.StackedInline):
@ -167,6 +169,7 @@ class EventoAdmin(CartExportMixin, admin.ModelAdmin):
)
autocomplete_fields = (
"tipo_evento",
"solicitacao",
"casa_anfitria",
"municipio",
)

Loading…
Cancel
Save