Browse Source

Resolve erros apontados pelos testes automaticos. Por exemplo, ordenacao dos imports

pull/282/head
Eduardo Calil 9 years ago
parent
commit
3f54c25e2e
  1. 14
      materia/forms.py
  2. 11
      materia/views.py

14
materia/forms.py

@ -1,27 +1,25 @@
import django_filters
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Column, Fieldset, Layout, Submit from crispy_forms.layout import HTML, Button, Column, Fieldset, Layout, Submit
from django import forms from django import forms
from django.db.models import Max
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django_filters import FilterSet from django.db.models import Max
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django_filters import FilterSet
import django_filters
import crispy_layout_mixin import crispy_layout_mixin
import sapl import sapl
from crispy_layout_mixin import form_actions from crispy_layout_mixin import form_actions
from norma.models import LegislacaoCitada, TipoNormaJuridica from norma.models import LegislacaoCitada, TipoNormaJuridica
from sapl.settings import MAX_DOC_UPLOAD_SIZE
from parlamentares.models import Parlamentar, Partido from parlamentares.models import Parlamentar, Partido
from sapl.settings import MAX_DOC_UPLOAD_SIZE
from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria, from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria,
DespachoInicial, DocumentoAcessorio, MateriaLegislativa, DespachoInicial, DocumentoAcessorio, MateriaLegislativa,
Numeracao, Origem, Proposicao, Relatoria, Numeracao, Origem, Proposicao, Relatoria,
StatusTramitacao, TipoAutor, StatusTramitacao, TipoAutor, TipoMateriaLegislativa,
TipoMateriaLegislativa, Tramitacao, UnidadeTramitacao) Tramitacao, UnidadeTramitacao)
def em_tramitacao(): def em_tramitacao():

11
materia/views.py

@ -14,6 +14,7 @@ from django.shortcuts import redirect
from django.template import Context, loader from django.template import Context, loader
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, FormView, ListView, TemplateView from django.views.generic import CreateView, FormView, ListView, TemplateView
from django_filters.views import FilterView
from base.models import CasaLegislativa from base.models import CasaLegislativa
from comissoes.models import Comissao, Composicao from comissoes.models import Comissao, Composicao
@ -1195,16 +1196,6 @@ class ProposicaoListView(ListView):
return context return context
def filter_tramitacao__status(status):
ultimas_tramitacoes = Tramitacao.objects.values(
'materia_id').annotate(data_encaminhamento=Max(
'data_encaminhamento'),
id=Max('id'))
import ipdb; ipdb.set_trace()
ultimas_tramitacoes = ultimas_tramitacoes.filter(status=status)
return ultimas_tramitacoes
class MateriaLegislativaPesquisaView(FilterView): class MateriaLegislativaPesquisaView(FilterView):
model = MateriaLegislativa model = MateriaLegislativa
filterset_class = MateriaLegislativaPesquisaFields filterset_class = MateriaLegislativaPesquisaFields

Loading…
Cancel
Save