diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index ccb56e7..8bb32f6 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -48,7 +48,7 @@ class TipoServicoAdmin(admin.ModelAdmin): class ServicoAdmin(admin.ModelAdmin): form = ServicoFormAdmin - list_display = ('casa_legislativa','getUf', 'tipo_servico', 'hospedagem_interlegis', 'data_ativacao', 'data_desativacao',) + list_display = ('casa_legislativa','getUf', 'tipo_servico', 'hospedagem_interlegis', 'data_ativacao', 'data_desativacao', 'getUrl') fieldsets = (( None, { 'fields': ('casa_legislativa', 'data_ativacao',) }), @@ -69,11 +69,16 @@ class ServicoAdmin(admin.ModelAdmin): inlines = (LogServicoInline,) def getUf(self, obj): - return '%s' % (obj.casa_legislativa.municipio.uf) - + return u'%s' % (obj.casa_legislativa.municipio.uf) getUf.short_description = 'UF' getUf.admin_order_field = 'casa_legislativa__municipio__uf' + def getUrl(self, obj): + return u'%s' % (obj.url, obj.url) + getUrl.short_description = 'Url' + getUrl.allow_tags = True + + def lookup_allowed(self, lookup, value): return super(ServicoAdmin, self).lookup_allowed(lookup, value) or \ lookup in ['casa_legislativa__municipio__uf__codigo_ibge__exact']