Browse Source

Fix QA messages

pull/98/head
Edward Ribeiro 9 years ago
parent
commit
512185d741
  1. 5
      sessao/urls.py
  2. 19
      sessao/views.py

5
sessao/urls.py

@ -9,14 +9,13 @@ from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView,
OradorExpedienteView, PainelView, OradorExpedienteView, PainelView,
PautaSessaoDetailView, PautaSessaoListView, PautaSessaoDetailView, PautaSessaoListView,
PresencaOrdemDiaView, PresencaView, ResumoView, PresencaOrdemDiaView, PresencaView, ResumoView,
SessaoListView, VotacaoEditView, SessaoCadastroView, SessaoListView, VotacaoEditView,
VotacaoExpedienteEditView, VotacaoExpedienteView, VotacaoExpedienteEditView, VotacaoExpedienteView,
VotacaoNominalEditView, VotacaoNominalEditView,
VotacaoNominalExpedienteEditView, VotacaoNominalExpedienteEditView,
VotacaoNominalExpedienteView, VotacaoNominalView, VotacaoNominalExpedienteView, VotacaoNominalView,
VotacaoView, sessao_crud, tipo_expediente_crud, VotacaoView, sessao_crud, tipo_expediente_crud,
tipo_resultado_votacao_crud, tipo_sessao_crud, tipo_resultado_votacao_crud, tipo_sessao_crud)
SessaoCadastroView)
urlpatterns_sessao = sessao_crud.urlpatterns + [ urlpatterns_sessao = sessao_crud.urlpatterns + [
url(r'^(?P<pk>\d+)/expediente$', url(r'^(?P<pk>\d+)/expediente$',

19
sessao/views.py

@ -1,17 +1,18 @@
from datetime import datetime from datetime import datetime
from re import sub from re import sub
from django.forms import ModelForm
from django import forms
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import (HTML, ButtonHolder, Column, Fieldset, Layout, from crispy_forms.layout import ButtonHolder, Fieldset, Layout, Submit
Submit) from django import forms
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.forms import ModelForm
from django.forms.util import ErrorList from django.forms.util import ErrorList
from django.utils.html import strip_tags 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
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
@ -2332,13 +2333,13 @@ class PautaSessaoDetailView(sessao_crud.CrudDetailView):
class SessaoForm(ModelForm): class SessaoForm(ModelForm):
class Meta: class Meta:
model = SessaoPlenaria model = SessaoPlenaria
fields = ['numero', fields = ['numero',
'tipo', 'tipo',
'legislatura', 'legislatura',
'sessao_legislativa', #Pega do Models os campos necessários para o form 'sessao_legislativa',
'data_inicio', 'data_inicio',
'hora_inicio', 'hora_inicio',
'iniciada', 'iniciada',
@ -2352,11 +2353,11 @@ class SessaoForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
row1 = sapl.layout.to_row( row1 = sapl.layout.to_row(
[('numero', 3), [('numero', 3),
('tipo', 3), ('tipo', 3),
('legislatura', 3), ('legislatura', 3),
('sessao_legislativa', 3)]) #Cria os campos ('sessao_legislativa', 3)])
row2 = sapl.layout.to_row( row2 = sapl.layout.to_row(
[('data_inicio', 4), [('data_inicio', 4),
@ -2379,7 +2380,7 @@ class SessaoForm(ModelForm):
self.helper = FormHelper() self.helper = FormHelper()
self.helper.layout = Layout( self.helper.layout = Layout(
Fieldset( Fieldset(
'Dados Básicos', #Desenha o HTML 'Dados Básicos',
row1, row1,
row2, row2,
row3, row3,

Loading…
Cancel
Save