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): class SenadorInline(admin.StackedInline):
model = Senador model = Senador
extra = 0 extra = 0
autocomplete_fields = ("partido",)
@admin.register(UnidadeFederativa) @admin.register(UnidadeFederativa)
@ -53,10 +54,16 @@ class MesorregiaoAdmin(admin.ModelAdmin):
"codigo_ibge", "codigo_ibge",
"uf__sigla", "uf__sigla",
) )
autocomplete_fields = ("uf",)
get_queryset = queryset_ascii get_queryset = queryset_ascii
inlines = (MicrorregiaoInline,) inlines = (MicrorregiaoInline,)
@admin.register(Microrregiao)
class MicrorregiaoAdmin(admin.ModelAdmin):
search_fields = ("search_text",)
@admin.register(Municipio) @admin.register(Municipio)
class MunicipioAdmin(admin.ModelAdmin): class MunicipioAdmin(admin.ModelAdmin):
actions = None actions = None
@ -111,6 +118,7 @@ class MunicipioAdmin(admin.ModelAdmin):
}, },
), ),
) )
autocomplete_fields = ("uf", "microrregiao")
search_fields = ("search_text", "codigo_ibge", "codigo_tse", "uf__sigla") 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): class EquipeInline(admin.StackedInline):
model = Equipe model = Equipe
autocomplete_fields = ("membro", "funcao")
class ConviteInline(admin.StackedInline): class ConviteInline(admin.StackedInline):
@ -97,6 +98,7 @@ class ConviteInline(admin.StackedInline):
class ModuloInline(admin.StackedInline): class ModuloInline(admin.StackedInline):
model = Modulo model = Modulo
autocomplete_fields = ("apresentador", "monitor")
class AnexoInline(admin.StackedInline): class AnexoInline(admin.StackedInline):
@ -167,6 +169,7 @@ class EventoAdmin(CartExportMixin, admin.ModelAdmin):
) )
autocomplete_fields = ( autocomplete_fields = (
"tipo_evento", "tipo_evento",
"solicitacao",
"casa_anfitria", "casa_anfitria",
"municipio", "municipio",
) )

Loading…
Cancel
Save