|
@ -308,9 +308,9 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): |
|
|
actions = ['adicionar_casas', ] |
|
|
actions = ['adicionar_casas', ] |
|
|
inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, |
|
|
inlines = (TelefonesInline, PresidenteInline, FuncionariosInline, |
|
|
ConveniosInline, ServicoInline, OcorrenciaInline,) |
|
|
ConveniosInline, ServicoInline, OcorrenciaInline,) |
|
|
list_display = ('nome', 'get_uf', 'get_gerentes', 'get_convenios', |
|
|
list_display = ('sigla', 'nome', 'get_uf', 'get_gerentes', 'get_convenios', |
|
|
'get_servicos') |
|
|
'get_servicos') |
|
|
list_display_links = ('nome',) |
|
|
list_display_links = ('sigla', 'nome',) |
|
|
list_filter = ('tipo', ('gerentes_interlegis', GerentesInterlegisFilter), |
|
|
list_filter = ('tipo', ('gerentes_interlegis', GerentesInterlegisFilter), |
|
|
'municipio__uf__nome', ConvenioFilter, ServicoFilter, |
|
|
'municipio__uf__nome', ConvenioFilter, ServicoFilter, |
|
|
'inclusao_digital',) |
|
|
'inclusao_digital',) |
|
@ -318,7 +318,7 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): |
|
|
queryset = queryset_ascii |
|
|
queryset = queryset_ascii |
|
|
fieldsets = ( |
|
|
fieldsets = ( |
|
|
(None, { |
|
|
(None, { |
|
|
'fields': ('tipo', 'nome', 'cnpj', 'num_parlamentares', |
|
|
'fields': ('tipo', 'nome', 'sigla', 'cnpj', 'num_parlamentares', |
|
|
'gerentes_interlegis') |
|
|
'gerentes_interlegis') |
|
|
}), |
|
|
}), |
|
|
(_(u'Endereço'), { |
|
|
(_(u'Endereço'), { |
|
@ -336,10 +336,10 @@ class OrgaoAdmin(ImageCroppingMixin, BaseModelAdmin): |
|
|
) |
|
|
) |
|
|
raw_id_fields = ('municipio',) |
|
|
raw_id_fields = ('municipio',) |
|
|
readonly_fields = ['num_parlamentares', 'gerentes_interlegis',] |
|
|
readonly_fields = ['num_parlamentares', 'gerentes_interlegis',] |
|
|
search_fields = ('search_text', 'cnpj', 'bairro', 'logradouro', |
|
|
search_fields = ('search_text', 'sigla', 'cnpj', 'bairro', 'logradouro', |
|
|
'cep', 'municipio__nome', 'municipio__uf__nome', |
|
|
'cep', 'municipio__nome', 'municipio__uf__nome', |
|
|
'municipio__codigo_ibge', 'pagina_web', 'observacoes') |
|
|
'municipio__codigo_ibge', 'pagina_web', 'observacoes') |
|
|
filter_horizontal = ('gerentes_interlegis',) |
|
|
# filter_horizontal = ('gerentes_interlegis',) |
|
|
|
|
|
|
|
|
def get_uf(self, obj): |
|
|
def get_uf(self, obj): |
|
|
return obj.municipio.uf.nome |
|
|
return obj.municipio.uf.nome |
|
|