|
@ -5,7 +5,7 @@ from django.core.urlresolvers import reverse |
|
|
from django.forms.models import ModelForm |
|
|
from django.forms.models import ModelForm |
|
|
from django.http import Http404, HttpResponseRedirect |
|
|
from django.http import Http404, HttpResponseRedirect |
|
|
from django.utils.encoding import force_unicode |
|
|
from django.utils.encoding import force_unicode |
|
|
from django.utils.translation import ugettext as _ |
|
|
from django.utils.translation import gettext as _ |
|
|
|
|
|
|
|
|
from sigi.apps.casas.admin import FuncionariosInline, GerentesInterlegisFilter |
|
|
from sigi.apps.casas.admin import FuncionariosInline, GerentesInterlegisFilter |
|
|
from sigi.apps.casas.models import Orgao |
|
|
from sigi.apps.casas.models import Orgao |
|
@ -187,7 +187,7 @@ class ServicoAdmin(BaseModelAdmin): |
|
|
return HttpResponseRedirect('.') |
|
|
return HttpResponseRedirect('.') |
|
|
adicionar_servicos.short_description = _(u"Armazenar serviços no carrinho para exportar") |
|
|
adicionar_servicos.short_description = _(u"Armazenar serviços no carrinho para exportar") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def calcular_data_uso(self, request, queryset): |
|
|
def calcular_data_uso(self, request, queryset): |
|
|
for servico in queryset: |
|
|
for servico in queryset: |
|
|
servico.atualiza_data_uso() |
|
|
servico.atualiza_data_uso() |
|
@ -253,7 +253,7 @@ class ServicoAdmin(BaseModelAdmin): |
|
|
obj.casa_legislativa = Orgao.objects.get(pk=id_casa) |
|
|
obj.casa_legislativa = Orgao.objects.get(pk=id_casa) |
|
|
|
|
|
|
|
|
return obj |
|
|
return obj |
|
|
|
|
|
|
|
|
def changelist_view(self, request, extra_context=None): |
|
|
def changelist_view(self, request, extra_context=None): |
|
|
from sigi.apps.convenios.views import normaliza_data |
|
|
from sigi.apps.convenios.views import normaliza_data |
|
|
request.GET._mutable = True |
|
|
request.GET._mutable = True |
|
@ -265,7 +265,7 @@ class ServicoAdmin(BaseModelAdmin): |
|
|
request, |
|
|
request, |
|
|
extra_context={'query_str': '?' + request.META['QUERY_STRING']} |
|
|
extra_context={'query_str': '?' + request.META['QUERY_STRING']} |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
def adicionar_servicos(self, request, queryset): |
|
|
def adicionar_servicos(self, request, queryset): |
|
|
if 'carrinho_servicos' in request.session: |
|
|
if 'carrinho_servicos' in request.session: |
|
|
q1 = len(request.session['carrinho_servicos']) |
|
|
q1 = len(request.session['carrinho_servicos']) |
|
|