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. 2
      sessao/serializers.py
  4. 4
      sessao/urls.py
  5. 5
      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

2
sessao/serializers.py

@ -1,6 +1,8 @@
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:

4
sessao/urls.py

@ -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,

5
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