|
|
@ -2192,7 +2192,7 @@ class MateriaLegislativaPesquisaView(MultiFormatOutputMixin, FilterView): |
|
|
paginate_by = 50 |
|
|
paginate_by = 50 |
|
|
|
|
|
|
|
|
export_fields = [ |
|
|
export_fields = [ |
|
|
'id', 'ano', 'numero', 'tipo__sigla', 'tipo__descricao', 'autoria', 'texto_original', 'ementa' |
|
|
'id', 'ano', 'numero', 'tipo__sigla', 'tipo__descricao', 'autoria', 'texto_original', 'texto_original_url', 'ementa' |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
def hook_texto_original(self, obj): |
|
|
def hook_texto_original(self, obj): |
|
|
@ -2201,6 +2201,12 @@ class MateriaLegislativaPesquisaView(MultiFormatOutputMixin, FilterView): |
|
|
obj, dict) else obj["texto_original"] |
|
|
obj, dict) else obj["texto_original"] |
|
|
return f'{url}/media/{texto_original}' |
|
|
return f'{url}/media/{texto_original}' |
|
|
|
|
|
|
|
|
|
|
|
def hook_texto_original_url(self, obj): |
|
|
|
|
|
""" |
|
|
|
|
|
Hook para retornar a URL absoluta do texto_original (facilita download) |
|
|
|
|
|
""" |
|
|
|
|
|
return self.hook_texto_original(obj) |
|
|
|
|
|
|
|
|
def hook_autoria(self, obj): |
|
|
def hook_autoria(self, obj): |
|
|
""" |
|
|
""" |
|
|
Hook específico para pegar nomes dos autores (reverse query) |
|
|
Hook específico para pegar nomes dos autores (reverse query) |
|
|
|