Browse Source

Troca raw_ids por autocompletes

pull/159/head
Sesostris Vieira 3 years ago
parent
commit
7b77dc47b9
  1. 8
      sigi/apps/casas/admin.py
  2. 6
      sigi/apps/convenios/admin.py
  3. 4
      sigi/apps/eventos/admin.py
  4. 2
      sigi/apps/servidores/admin.py

8
sigi/apps/casas/admin.py

@ -91,7 +91,7 @@ class PresidenteInline(admin.StackedInline):
"cep", "cep",
"redes_sociais", "redes_sociais",
) )
raw_id_fields = ("municipio",) autocomplete_fields = ("municipio",)
readonly_fields = ("ult_alteracao",) readonly_fields = ("ult_alteracao",)
extra = 1 extra = 1
max_num = 1 max_num = 1
@ -128,7 +128,7 @@ class ContatoInterlegisInline(admin.StackedInline):
"desativado", "desativado",
"observacoes", "observacoes",
) )
raw_id_fields = ("municipio",) autocomplete_fields = ("municipio",)
readonly_fields = ("ult_alteracao",) readonly_fields = ("ult_alteracao",)
extra = 1 extra = 1
inlines = (TelefonesInline,) inlines = (TelefonesInline,)
@ -167,7 +167,7 @@ class FuncionariosInline(admin.StackedInline):
"desativado", "desativado",
"observacoes", "observacoes",
) )
raw_id_fields = ("municipio",) autocomplete_fields = ("municipio",)
readonly_fields = ("ult_alteracao",) readonly_fields = ("ult_alteracao",)
extra = 1 extra = 1
inlines = (TelefonesInline,) inlines = (TelefonesInline,)
@ -463,7 +463,7 @@ class OrgaoAdmin(CartExportReportMixin, admin.ModelAdmin):
}, },
), ),
) )
raw_id_fields = ("municipio",) autocomplete_fields = ("municipio",)
readonly_fields = [ readonly_fields = [
"gerentes_interlegis", "gerentes_interlegis",
] ]

6
sigi/apps/convenios/admin.py

@ -60,7 +60,7 @@ class AnexoAdmin(admin.ModelAdmin):
"data_pub", "data_pub",
] ]
list_display = ("arquivo", "descricao", "data_pub", "convenio") list_display = ("arquivo", "descricao", "data_pub", "convenio")
raw_id_fields = ("convenio",) autocomplete_fields = ("convenio",)
search_fields = ( search_fields = (
"descricao", "descricao",
"convenio__id", "convenio__id",
@ -169,7 +169,7 @@ class ConvenioAdmin(CartExportReportMixin, admin.ModelAdmin):
"casa_legislativa__municipio__uf", "casa_legislativa__municipio__uf",
) )
ordering = ("casa_legislativa", "-data_retorno_assinatura") ordering = ("casa_legislativa", "-data_retorno_assinatura")
raw_id_fields = ("casa_legislativa",) autocomplete_fields = ("casa_legislativa",)
get_queryset = queryset_ascii get_queryset = queryset_ascii
search_fields = ( search_fields = (
"id", "id",
@ -319,7 +319,7 @@ class EquipamentoPrevistoAdmin(admin.ModelAdmin):
list_display = ("convenio", "equipamento", "quantidade") list_display = ("convenio", "equipamento", "quantidade")
list_display_links = ("convenio", "equipamento") list_display_links = ("convenio", "equipamento")
ordering = ("convenio", "equipamento") ordering = ("convenio", "equipamento")
raw_id_fields = ("convenio", "equipamento") autocomplete_fields = ("convenio", "equipamento")
search_fields = ( search_fields = (
"convenio__id", "convenio__id",
"equipamento__fabricante__nome", "equipamento__fabricante__nome",

4
sigi/apps/eventos/admin.py

@ -113,7 +113,7 @@ class EquipeInline(admin.StackedInline):
class ConviteInline(admin.StackedInline): class ConviteInline(admin.StackedInline):
model = Convite model = Convite
raw_id_fields = ("casa",) autocomplete_fields = ("casa",)
class ModuloInline(admin.StackedInline): class ModuloInline(admin.StackedInline):
@ -150,7 +150,7 @@ class EventoAdmin(CartExportMixin, admin.ModelAdmin):
"municipio__uf", "municipio__uf",
"solicitante", "solicitante",
) )
raw_id_fields = ( autocomplete_fields = (
"casa_anfitria", "casa_anfitria",
"municipio", "municipio",
) )

2
sigi/apps/servidores/admin.py

@ -105,7 +105,7 @@ class ServidorAdmin(admin.ModelAdmin):
"servico__nome", "servico__nome",
"servico__sigla", "servico__sigla",
) )
raw_id_fields = ("user",) autocomplete_fields = ("user",)
fieldsets = ( fieldsets = (
( (
None, None,

Loading…
Cancel
Save