Browse Source

Adiciona DateRangeFilters nos convênios

revisaoSidenav
Sesostris Vieira 3 years ago
parent
commit
c0b90f031c
  1. 14
      sigi/apps/convenios/admin.py

14
sigi/apps/convenios/admin.py

@ -2,7 +2,6 @@ from django.contrib import admin
from django.http import HttpResponse, HttpResponseRedirect from django.http import HttpResponse, HttpResponseRedirect
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from import_export.fields import Field
from sigi.apps.convenios.models import (Projeto, StatusConvenio, from sigi.apps.convenios.models import (Projeto, StatusConvenio,
TipoSolicitacao, Convenio, TipoSolicitacao, Convenio,
EquipamentoPrevisto, Anexo, Tramitacao, EquipamentoPrevisto, Anexo, Tramitacao,
@ -11,6 +10,7 @@ from sigi.apps.utils import queryset_ascii
from sigi.apps.servidores.models import Servidor from sigi.apps.servidores.models import Servidor
from sigi.apps.casas.admin import GerentesInterlegisFilter from sigi.apps.casas.admin import GerentesInterlegisFilter
from sigi.apps.utils.mixins import CartExportReportMixin, LabeledResourse from sigi.apps.utils.mixins import CartExportReportMixin, LabeledResourse
from sigi.apps.utils.filters import DateRangeFilter
class ConvenioExportResourse(LabeledResourse): class ConvenioExportResourse(LabeledResourse):
class Meta: class Meta:
@ -73,10 +73,14 @@ class ConvenioAdmin(CartExportReportMixin, admin.ModelAdmin):
'status_convenio', 'link_sigad', 'data_retorno_assinatura', 'status_convenio', 'link_sigad', 'data_retorno_assinatura',
'data_termino_vigencia',) 'data_termino_vigencia',)
list_display_links = ('num_convenio', 'casa_legislativa',) list_display_links = ('num_convenio', 'casa_legislativa',)
list_filter = (('casa_legislativa__gerentes_interlegis', list_filter = (
GerentesInterlegisFilter), 'projeto', ('data_retorno_assinatura', DateRangeFilter),
'casa_legislativa__tipo', 'conveniada','equipada', ('data_sigi', DateRangeFilter), ('data_solicitacao', DateRangeFilter),
'casa_legislativa__municipio__uf',) ('data_sigad', DateRangeFilter),
('casa_legislativa__gerentes_interlegis', GerentesInterlegisFilter),
'projeto', 'casa_legislativa__tipo', 'conveniada','equipada',
'casa_legislativa__municipio__uf',
)
ordering = ('casa_legislativa', '-data_retorno_assinatura') ordering = ('casa_legislativa', '-data_retorno_assinatura')
raw_id_fields = ('casa_legislativa',) raw_id_fields = ('casa_legislativa',)
get_queryset = queryset_ascii get_queryset = queryset_ascii

Loading…
Cancel
Save