Browse Source

Make QA happy again!

pull/153/head
Edward Ribeiro 9 years ago
parent
commit
0872c3fd60
  1. 15
      compilacao/forms.py
  2. 1
      parlamentares/views.py
  3. 8
      sessao/serializers.py
  4. 6
      sessao/urls.py
  5. 7
      sessao/views.py

15
compilacao/forms.py

@ -9,9 +9,9 @@ from django.forms.models import ModelForm
from django.utils.translation import ugettext_lazy as _
from compilacao.models import (PARTICIPACAO_SOCIAL_CHOICES, Dispositivo, Nota,
TextoArticulado, TipoNota, TipoTextoArticulado,
TipoVide, Vide, TipoPublicacao,
VeiculoPublicacao, Publicacao)
Publicacao, TextoArticulado, TipoNota,
TipoPublicacao, TipoTextoArticulado, TipoVide,
VeiculoPublicacao, Vide)
from compilacao.utils import YES_NO_CHOICES, FormLayout, to_column, to_row
@ -131,11 +131,12 @@ class TaForm(ModelForm):
self.helper = FormHelper()
self.helper.layout = FormLayout(
Fieldset(_('Identificação Básica'), row1, css_class="large-12"),
Fieldset(TextoArticulado._meta.get_field(
'ementa').verbose_name, Column('ementa'), css_class="large-12"),
Fieldset(
TextoArticulado._meta.get_field(
'observacao').verbose_name, Column('observacao'), css_class="large-12"),
TextoArticulado._meta.get_field('ementa').verbose_name,
Column('ementa'), css_class="large-12"),
Fieldset(
TextoArticulado._meta.get_field('observacao').verbose_name,
Column('observacao'), css_class="large-12"),
)

1
parlamentares/views.py

@ -11,7 +11,6 @@ from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.views.generic.edit import FormMixin
from vanilla import GenericView
from django.core.exceptions import ObjectDoesNotExist
import sapl
from sapl.crud import build_crud

8
sessao/serializers.py

@ -1,8 +1,10 @@
from rest_framework import serializers
from .models import SessaoPlenaria
class SessaoPlenariaSerializer(serializers.ModelSerializer):
class Meta:
model = SessaoPlenaria
fields = ('tipo', 'legislatura', 'sessao_legislativa')
class Meta:
model = SessaoPlenaria
fields = ('tipo', 'legislatura', 'sessao_legislativa')

6
sessao/urls.py

@ -10,7 +10,7 @@ from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView,
OradorExpedienteView, PainelView,
PautaSessaoDetailView, PautaSessaoListView,
PresencaOrdemDiaView, PresencaView, ResumoView,
SessaoCadastroView, SessaoListView,
SessaoCadastroView, SessaoListView,
SessaoPlenariaView, VotacaoEditView,
VotacaoExpedienteEditView, VotacaoExpedienteView,
VotacaoNominalEditView,
@ -94,7 +94,9 @@ urlpatterns_sessao = sessao_crud.urlpatterns + [
sessao_urls = urlpatterns_sessao, sessao_crud.namespace, sessao_crud.namespace
sessao_rest = [url(r'^sessao$', SessaoPlenariaView.as_view(), name='sessao_rest'),]
sessao_rest = [
url(r'^sessao$', SessaoPlenariaView.as_view(), name='sessao_rest')
]
urlpatterns = [
url(r'^sessao/', include(urlpatterns_sessao,

7
sessao/views.py

@ -12,12 +12,13 @@ from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _
from django.views.generic import ListView
from django.views.generic.edit import FormMixin
from sessao.serializers import SessaoPlenariaSerializer
from rest_framework import generics
import sapl
from materia.models import Autoria, TipoMateriaLegislativa
from parlamentares.models import Parlamentar
from sapl.crud import build_crud
from sessao.serializers import SessaoPlenariaSerializer
from .models import (CargoMesa, ExpedienteMateria, ExpedienteSessao,
IntegranteMesa, MateriaLegislativa, Orador,
@ -2438,5 +2439,5 @@ class SessaoCadastroView(FormMixin, sessao_crud.CrudDetailView):
class SessaoPlenariaView(generics.ListAPIView):
queryset = SessaoPlenaria.objects.select_related('sessao_legislativa').all()
serializer_class = SessaoPlenariaSerializer
queryset = SessaoPlenaria.objects.all()
serializer_class = SessaoPlenariaSerializer

Loading…
Cancel
Save