diff --git a/painel/views.py b/painel/views.py index a82ad11a5..b67bf28eb 100644 --- a/painel/views.py +++ b/painel/views.py @@ -54,7 +54,7 @@ def cronometro_painel(request): def painel_view(request, pk): print(pk) - context = {'head_title': 'Painel Plenário', 'sessao_id': pk} + context = {'head_title': 'Painel Plenário', 'sessao_id': pk} return render(request, 'painel/index.html', {'context': context}) diff --git a/protocoloadm/migrations/0005_auto_20151008_0744.py b/protocoloadm/migrations/0005_auto_20151008_0744.py new file mode 100644 index 000000000..a7e93611a --- /dev/null +++ b/protocoloadm/migrations/0005_auto_20151008_0744.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import protocoloadm.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0004_auto_20151007_1035'), + ] + + operations = [ + migrations.AlterField( + model_name='documentoacessorioadministrativo', + name='arquivo', + field=models.FileField(blank=True, null=True, upload_to=protocoloadm.models.texto_upload_path, verbose_name='Arquivo'), + ), + ] diff --git a/protocoloadm/urls.py b/protocoloadm/urls.py index cb95c1f45..862c8ea3b 100644 --- a/protocoloadm/urls.py +++ b/protocoloadm/urls.py @@ -1,4 +1,5 @@ from django.conf.urls import include, url + from protocoloadm.views import (ProtocoloPesquisaView, anular_protocolo_crud, documento_acessorio_administrativo_crud, documento_administrativo_crud, diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 0d1a14071..1b3259b7a 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -1,8 +1,11 @@ +from datetime import datetime + from django import forms from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.views.generic import ListView from django.views.generic.edit import FormMixin + from materia.models import TipoMateriaLegislativa from sapl.crud import build_crud @@ -117,7 +120,7 @@ class ProtocoloPesquisaView(ListView, FormMixin): def get_context_data(self, **kwargs): context = super(ProtocoloPesquisaView, self).get_context_data(**kwargs) context.update(self.extra_context) - return context + return context def get_queryset(self): return Protocolo.objects.all() @@ -133,6 +136,8 @@ class ProtocoloPesquisaView(ListView, FormMixin): if form.is_valid(): kwargs = {} + # format = '%Y-%m-%d' + if request.POST['tipo_protocolo']: kwargs['tipo_protocolo'] = request.POST['tipo_protocolo'] @@ -143,10 +148,11 @@ class ProtocoloPesquisaView(ListView, FormMixin): kwargs['ano'] = request.POST['ano'] if request.POST['inicial']: - kwargs['inicial'] = request.POST['inicial'] + kwargs['data'] = datetime.strptime( + request.POST['inicial'], '%d/%m/%Y').strftime('%Y-%m-%d') - if request.POST['final']: - kwargs['final'] = request.POST['final'] + # if request.POST['final']: + # kwargs['final'] = request.POST['final'] if request.POST['tipo_documento']: kwargs['tipo_documento'] = request.POST['tipo_documento'] diff --git a/templates/protocoloadm/protocolo_pesquisa.html b/templates/protocoloadm/protocolo_pesquisa.html index f4a04128d..a2f32a6a1 100644 --- a/templates/protocoloadm/protocolo_pesquisa.html +++ b/templates/protocoloadm/protocolo_pesquisa.html @@ -70,8 +70,19 @@ {% if protocolos %}
Número de Protocolo | +Assunto | +Tipo de Documento | +Ano | +Data | +
{{ p.numero }} | {{ p.assunto_ementa }} | |||
{{ p.numero }} | +{{ p.assunto_ementa }} | +{{ p.tipo_documento }} | +{{ p.ano }} | +{{ p.data|date:"d/m/Y" }} | +