Browse Source

Fix QA complains

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
d3c666860b
  1. 4
      protocoloadm/urls.py
  2. 31
      protocoloadm/views.py

4
protocoloadm/urls.py

@ -1,10 +1,10 @@
from django.conf.urls import include, url
from protocoloadm.views import (AnularProtocoloAdmView,
DetailDocumentoAdministrativo,
DocumentoAcessorioAdministrativoView,
PesquisarDocumentoAdministrativo,
ProposicaoReceberView,
ProposicaoView,
ProposicaoReceberView, ProposicaoView,
ProposicoesIncorporadasView,
ProposicoesNaoIncorporadasView,
ProposicoesNaoRecebidasView,

31
protocoloadm/views.py

@ -2,7 +2,7 @@ from datetime import date, datetime
from re import sub
from crispy_forms.helper import FormHelper
from crispy_forms.layout import ButtonHolder, Fieldset, Layout, Submit, HTML
from crispy_forms.layout import ButtonHolder, Fieldset, Layout, Submit
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
@ -16,14 +16,10 @@ from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, ListView
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormMixin
from django.views.generic import FormView
from django.views.generic import DetailView
from vanilla import GenericView
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Field
from materia.models import Proposicao, TipoMateriaLegislativa
from sapl.crud import build_crud
from vanilla import GenericView
from .models import (Autor, DocumentoAcessorioAdministrativo,
DocumentoAdministrativo, Protocolo,
@ -523,6 +519,7 @@ class ProposicoesNaoRecebidasView(ListView):
def get_queryset(self):
return Proposicao.objects.filter(data_envio__isnull=False, status='E')
class ProposicoesNaoIncorporadasView(ListView):
template_name = "protocoloadm/proposicoes_naoincorporadas.html"
model = Proposicao
@ -545,6 +542,7 @@ class ProposicoesIncorporadasView(ListView):
data_recebimento__isnull=False,
status='I')
class ProposicaoSimpleForm(forms.Form):
tipo = forms.CharField(label='Tipo',
@ -554,9 +552,13 @@ class ProposicaoSimpleForm(forms.Form):
widget=forms.TextInput(
attrs={'readonly': 'readonly'}))
data_envio = forms.DateField(label='Data Envio',
widget=forms.DateInput(format = '%d/%m/%Y', attrs={'readonly':'readonly'}))
widget=forms.DateInput(
format='%d/%m/%Y',
attrs={'readonly': 'readonly'}))
data_recebimento = forms.DateField(label='Data Recebimento',
widget=forms.DateInput(format = '%d/%m/%Y', attrs={'readonly':'readonly'}))
widget=forms.DateInput(
format='%d/%m/%Y',
attrs={'readonly': 'readonly'}))
descricao = forms.CharField(label='Descrição',
widget=forms.TextInput(
@ -722,8 +724,10 @@ class DetailDocumentoAdministrativo(DetailView):
class ModelFormDocumentoAcessorioAdministrativo(ModelForm):
data = forms.DateField(label=u'Data', input_formats=['%d/%m/%Y'],
required=False, widget=forms.DateInput(format='%d/%m/%Y'))
data = forms.DateField(label=u'Data',
input_formats=['%d/%m/%Y'],
required=False,
widget=forms.DateInput(format='%d/%m/%Y'))
class Meta:
model = DocumentoAcessorioAdministrativo
@ -751,8 +755,8 @@ class ModelFormDocumentoAcessorioAdministrativo(ModelForm):
)
),
)
super(ModelFormDocumentoAcessorioAdministrativo, self).__init__(*args, **kwargs)
super(ModelFormDocumentoAcessorioAdministrativo,
self).__init__(*args, **kwargs)
class DocumentoAcessorioAdministrativoView(FormMixin, GenericView):
@ -792,7 +796,8 @@ class DocumentoAcessorioAdministrativoView(FormMixin, GenericView):
return self.form_valid(form)
else:
print(form['data'])
import ipdb; ipdb.set_trace()
import ipdb
ipdb.set_trace()
return self.form_invalid(form)
# return HttpResponseRedirect(self.get_success_url())

Loading…
Cancel
Save