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

6
sigi/apps/convenios/admin.py

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

4
sigi/apps/eventos/admin.py

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

2
sigi/apps/servidores/admin.py

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

Loading…
Cancel
Save