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 django.utils.translation import ugettext_lazy as _
from compilacao.models import (PARTICIPACAO_SOCIAL_CHOICES, Dispositivo, Nota, from compilacao.models import (PARTICIPACAO_SOCIAL_CHOICES, Dispositivo, Nota,
TextoArticulado, TipoNota, TipoTextoArticulado, Publicacao, TextoArticulado, TipoNota,
TipoVide, Vide, TipoPublicacao, TipoPublicacao, TipoTextoArticulado, TipoVide,
VeiculoPublicacao, Publicacao) VeiculoPublicacao, Vide)
from compilacao.utils import YES_NO_CHOICES, FormLayout, to_column, to_row from compilacao.utils import YES_NO_CHOICES, FormLayout, to_column, to_row
@ -131,11 +131,12 @@ class TaForm(ModelForm):
self.helper = FormHelper() self.helper = FormHelper()
self.helper.layout = FormLayout( self.helper.layout = FormLayout(
Fieldset(_('Identificação Básica'), row1, css_class="large-12"), 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( Fieldset(
TextoArticulado._meta.get_field( TextoArticulado._meta.get_field('ementa').verbose_name,
'observacao').verbose_name, Column('observacao'), css_class="large-12"), 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.utils.translation import ugettext_lazy as _
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from vanilla import GenericView from vanilla import GenericView
from django.core.exceptions import ObjectDoesNotExist
import sapl import sapl
from sapl.crud import build_crud from sapl.crud import build_crud

8
sessao/serializers.py

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

6
sessao/urls.py

@ -10,7 +10,7 @@ from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView,
OradorExpedienteView, PainelView, OradorExpedienteView, PainelView,
PautaSessaoDetailView, PautaSessaoListView, PautaSessaoDetailView, PautaSessaoListView,
PresencaOrdemDiaView, PresencaView, ResumoView, PresencaOrdemDiaView, PresencaView, ResumoView,
SessaoCadastroView, SessaoListView, SessaoCadastroView, SessaoListView,
SessaoPlenariaView, VotacaoEditView, SessaoPlenariaView, VotacaoEditView,
VotacaoExpedienteEditView, VotacaoExpedienteView, VotacaoExpedienteEditView, VotacaoExpedienteView,
VotacaoNominalEditView, VotacaoNominalEditView,
@ -94,7 +94,9 @@ urlpatterns_sessao = sessao_crud.urlpatterns + [
sessao_urls = urlpatterns_sessao, sessao_crud.namespace, sessao_crud.namespace 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 = [ urlpatterns = [
url(r'^sessao/', include(urlpatterns_sessao, 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.utils.translation import ugettext_lazy as _
from django.views.generic import ListView from django.views.generic import ListView
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from sessao.serializers import SessaoPlenariaSerializer
from rest_framework import generics from rest_framework import generics
import sapl import sapl
from materia.models import Autoria, TipoMateriaLegislativa from materia.models import Autoria, TipoMateriaLegislativa
from parlamentares.models import Parlamentar from parlamentares.models import Parlamentar
from sapl.crud import build_crud from sapl.crud import build_crud
from sessao.serializers import SessaoPlenariaSerializer
from .models import (CargoMesa, ExpedienteMateria, ExpedienteSessao, from .models import (CargoMesa, ExpedienteMateria, ExpedienteSessao,
IntegranteMesa, MateriaLegislativa, Orador, IntegranteMesa, MateriaLegislativa, Orador,
@ -2438,5 +2439,5 @@ class SessaoCadastroView(FormMixin, sessao_crud.CrudDetailView):
class SessaoPlenariaView(generics.ListAPIView): class SessaoPlenariaView(generics.ListAPIView):
queryset = SessaoPlenaria.objects.select_related('sessao_legislativa').all() queryset = SessaoPlenaria.objects.all()
serializer_class = SessaoPlenariaSerializer serializer_class = SessaoPlenariaSerializer

Loading…
Cancel
Save