diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 65aa5fe..b0ed55d 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -77,6 +77,11 @@ class CasaLegislativaAdmin(admin.ModelAdmin): request, extra_context={'query_str': '?' + request.META['QUERY_STRING']} ) + + def lookup_allowed(self, lookup, value): + return super(CasaLegislativaAdmin, self).lookup_allowed(lookup, value) or \ + lookup in ['municipio__uf__codigo_ibge__exact'] + def etiqueta(self,request,queryset): return labels_report(request,queryset=queryset) diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 06027ef..4061729 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -130,6 +130,10 @@ class CasaAtendidaAdmin(admin.ModelAdmin): search_fields = ('search_text','cnpj', 'bairro', 'logradouro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') + + def lookup_allowed(self, lookup, value): + return super(CasaAtendidaAdmin, self).lookup_allowed(lookup, value) or \ + lookup in ['municipio__uf__codigo_ibge__exact'] def change_view(self, request, object_id, extra_context=None): # Se a Casa ainda não é atendida, gerar o código interlegis para ela