@ -2,7 +2,7 @@ from datetime import date, datetime
from re import sub
from re import sub
from crispy_forms . helper import FormHelper
from crispy_forms . helper import FormHelper
from crispy_forms . layout import ButtonHolder , Column , Fieldset , Layout , Submit
from crispy_forms . layout import Column , Fieldset , Layout
from django import forms
from django import forms
from django . contrib import messages
from django . contrib import messages
from django . core . exceptions import ObjectDoesNotExist
from django . core . exceptions import ObjectDoesNotExist
@ -18,6 +18,7 @@ from django.views.generic.edit import FormMixin
from vanilla . views import GenericView
from vanilla . views import GenericView
import sapl
import sapl
from sapl . layout import form_actions
from comissoes . models import Comissao , Composicao
from comissoes . models import Comissao , Composicao
from compilacao . views import IntegracaoTaView
from compilacao . views import IntegracaoTaView
from norma . models import LegislacaoCitada , NormaJuridica , TipoNormaJuridica
from norma . models import LegislacaoCitada , NormaJuridica , TipoNormaJuridica
@ -297,10 +298,7 @@ class FormularioSimplificadoForm(ModelForm):
' Identificação Básica ' ,
' Identificação Básica ' ,
row1 , row2 , row3 , row4
row1 , row2 , row3 , row4
) ,
) ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( FormularioSimplificadoForm , self ) . __init__ ( * args , * * kwargs )
super ( FormularioSimplificadoForm , self ) . __init__ ( * args , * * kwargs )
@ -376,10 +374,7 @@ class FormularioCadastroForm(ModelForm):
' indexacao ' ,
' indexacao ' ,
' observacao '
' observacao '
) ,
) ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( FormularioCadastroForm , self ) . __init__ ( * args , * * kwargs )
super ( FormularioCadastroForm , self ) . __init__ ( * args , * * kwargs )
@ -473,10 +468,7 @@ class MateriaAnexadaForm(ModelForm):
Fieldset (
Fieldset (
' Anexar Matéria ' ,
' Anexar Matéria ' ,
row1 , row2 ,
row1 , row2 ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Anexar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( MateriaAnexadaForm , self ) . __init__ (
super ( MateriaAnexadaForm , self ) . __init__ (
@ -493,7 +485,7 @@ class MateriaAnexadaView(FormMixin, GenericView):
anexadas = Anexada . objects . filter (
anexadas = Anexada . objects . filter (
materia_principal_id = kwargs [ ' pk ' ] )
materia_principal_id = kwargs [ ' pk ' ] )
return self . render_to_response ( { ' materialegislativa ' : materia ,
return self . render_to_response ( { ' object ' : materia ,
' anexadas ' : anexadas ,
' anexadas ' : anexadas ,
' form ' : form } )
' form ' : form } )
@ -575,7 +567,7 @@ class MateriaAnexadaEditView(FormMixin, GenericView):
form = MateriaAnexadaForm ( initial = data )
form = MateriaAnexadaForm ( initial = data )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' data ' : data ,
' data ' : data ,
' get_tipos_materia ' : TipoMateriaLegislativa . objects . all ( ) } )
' get_tipos_materia ' : TipoMateriaLegislativa . objects . all ( ) } )
@ -655,10 +647,7 @@ class DespachoInicialFom(ModelForm):
Fieldset (
Fieldset (
' Adicionar Despacho Inicial ' ,
' Adicionar Despacho Inicial ' ,
' comissao ' ,
' comissao ' ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( DespachoInicialFom , self ) . __init__ ( * args , * * kwargs )
super ( DespachoInicialFom , self ) . __init__ ( * args , * * kwargs )
@ -673,7 +662,7 @@ class DespachoInicialView(FormMixin, GenericView):
form = DespachoInicialFom ( )
form = DespachoInicialFom ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' despachos ' : despacho } )
' despachos ' : despacho } )
@ -690,7 +679,7 @@ class DespachoInicialView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' despachos ' : despacho } )
' despachos ' : despacho } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -707,7 +696,7 @@ class DespachoInicialEditView(FormMixin, GenericView):
form = DespachoInicialFom ( )
form = DespachoInicialFom ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' despacho ' : despacho ,
' despacho ' : despacho ,
' comissoes ' : Comissao . objects . all ( ) } )
' comissoes ' : Comissao . objects . all ( ) } )
@ -728,7 +717,7 @@ class DespachoInicialEditView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' despacho ' : despacho ,
' despacho ' : despacho ,
' comissoes ' : Comissao . objects . all ( ) } )
' comissoes ' : Comissao . objects . all ( ) } )
@ -824,10 +813,7 @@ class LegislacaoCitadaForm(ModelForm):
Fieldset (
Fieldset (
' Incluir Legislação Citada ' ,
' Incluir Legislação Citada ' ,
row1 , row2 , row3 , row4 ,
row1 , row2 , row3 , row4 ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( LegislacaoCitadaForm , self ) . __init__ ( * args , * * kwargs )
super ( LegislacaoCitadaForm , self ) . __init__ ( * args , * * kwargs )
@ -842,7 +828,7 @@ class LegislacaoCitadaView(FormMixin, GenericView):
form = LegislacaoCitadaForm ( )
form = LegislacaoCitadaForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' legislacao ' : legislacao } )
' legislacao ' : legislacao } )
@ -864,7 +850,7 @@ class LegislacaoCitadaView(FormMixin, GenericView):
msg = ' Norma Juridica não existe. '
msg = ' Norma Juridica não existe. '
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' legislacao ' : legislacao_list } )
' legislacao ' : legislacao_list } )
legislacao . materia = materia
legislacao . materia = materia
legislacao . norma = norma
legislacao . norma = norma
@ -885,7 +871,7 @@ class LegislacaoCitadaView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' legislacao ' : legislacao_list } )
' legislacao ' : legislacao_list } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -906,7 +892,7 @@ class LegislacaoCitadaEditView(FormMixin, GenericView):
form = LegislacaoCitadaForm ( )
form = LegislacaoCitadaForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' legislacao ' : legislacao ,
' legislacao ' : legislacao ,
' tipos_norma ' : TipoNormaJuridica . objects . all ( ) } )
' tipos_norma ' : TipoNormaJuridica . objects . all ( ) } )
@ -931,7 +917,7 @@ class LegislacaoCitadaEditView(FormMixin, GenericView):
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response (
return self . render_to_response (
{ ' form ' : form ,
{ ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' legislacao ' : legislacao ,
' legislacao ' : legislacao ,
' tipos_norma ' : TipoNormaJuridica . objects . all ( ) } )
' tipos_norma ' : TipoNormaJuridica . objects . all ( ) } )
legislacao . materia = materia
legislacao . materia = materia
@ -954,7 +940,7 @@ class LegislacaoCitadaEditView(FormMixin, GenericView):
else :
else :
return self . render_to_response (
return self . render_to_response (
{ ' form ' : form ,
{ ' form ' : form ,
' materialegislativa ' : materia } )
' object ' : materia } )
class NumeracaoForm ( ModelForm ) :
class NumeracaoForm ( ModelForm ) :
@ -1002,10 +988,7 @@ class NumeracaoForm(ModelForm):
Fieldset (
Fieldset (
' Incluir Numeração ' ,
' Incluir Numeração ' ,
row1 , row2 ,
row1 , row2 ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( NumeracaoForm , self ) . __init__ ( * args , * * kwargs )
super ( NumeracaoForm , self ) . __init__ ( * args , * * kwargs )
@ -1020,7 +1003,7 @@ class NumeracaoView(FormMixin, GenericView):
form = NumeracaoForm ( )
form = NumeracaoForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' numeracao ' : numeracao } )
' numeracao ' : numeracao } )
@ -1045,7 +1028,7 @@ class NumeracaoView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' numeracao ' : numeracao_list } )
' numeracao ' : numeracao_list } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -1062,7 +1045,7 @@ class NumeracaoEditView(FormMixin, GenericView):
form = NumeracaoForm ( )
form = NumeracaoForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' numeracao ' : numeracao ,
' numeracao ' : numeracao ,
' tipos ' : TipoMateriaLegislativa . objects . all ( ) } )
' tipos ' : TipoMateriaLegislativa . objects . all ( ) } )
@ -1089,7 +1072,7 @@ class NumeracaoEditView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' numeracao ' : numeracao } )
' numeracao ' : numeracao } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -1147,10 +1130,7 @@ class DocumentoAcessorioForm(ModelForm):
Fieldset (
Fieldset (
' Incluir Documento Acessório ' ,
' Incluir Documento Acessório ' ,
row1 , row2 , row3 ,
row1 , row2 , row3 ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
)
)
super ( DocumentoAcessorioForm , self ) . __init__ ( * args , * * kwargs )
super ( DocumentoAcessorioForm , self ) . __init__ ( * args , * * kwargs )
@ -1165,7 +1145,7 @@ class DocumentoAcessorioView(FormMixin, GenericView):
form = DocumentoAcessorioForm ( )
form = DocumentoAcessorioForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' docs ' : docs } )
' docs ' : docs } )
@ -1191,7 +1171,7 @@ class DocumentoAcessorioView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' docs ' : docs_list } )
' docs ' : docs_list } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -1208,7 +1188,7 @@ class DocumentoAcessorioEditView(FormMixin, GenericView):
form = DocumentoAcessorioForm ( )
form = DocumentoAcessorioForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' doc ' : documento ,
' doc ' : documento ,
' tipos ' : TipoDocumento . objects . all ( ) } )
' tipos ' : TipoDocumento . objects . all ( ) } )
@ -1235,7 +1215,7 @@ class DocumentoAcessorioEditView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' doc ' : documento } )
' doc ' : documento } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -1287,7 +1267,7 @@ class RelatoriaEditView(FormMixin, GenericView):
parlamentares = composicao . participacao_set . all ( )
parlamentares = composicao . participacao_set . all ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' relatoria ' : relatoria ,
' relatoria ' : relatoria ,
' tipo_fim_relatorias ' : TipoFimRelatoria . objects . all ( ) ,
' tipo_fim_relatorias ' : TipoFimRelatoria . objects . all ( ) ,
@ -1319,7 +1299,7 @@ class RelatoriaEditView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' relatoria ' : relatoria ,
' relatoria ' : relatoria ,
' tipo_fim_relatorias ' : TipoFimRelatoria . objects . all ( ) ,
' tipo_fim_relatorias ' : TipoFimRelatoria . objects . all ( ) ,
@ -1355,7 +1335,7 @@ class RelatoriaView(FormMixin, GenericView):
parlamentares = composicao . participacao_set . all ( )
parlamentares = composicao . participacao_set . all ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' relatorias ' : relatorias ,
' relatorias ' : relatorias ,
' comissao ' : comissao ,
' comissao ' : comissao ,
@ -1378,14 +1358,14 @@ class RelatoriaView(FormMixin, GenericView):
msg = ' O local atual deve ser uma Comissão! '
msg = ' O local atual deve ser uma Comissão! '
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' relatorias ' : relatorias } )
' relatorias ' : relatorias } )
else :
else :
composicao = Composicao . objects . filter ( comissao = comissao ) . last ( )
composicao = Composicao . objects . filter ( comissao = comissao ) . last ( )
parlamentares = composicao . participacao_set . all ( )
parlamentares = composicao . participacao_set . all ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' relatorias ' : relatorias ,
' relatorias ' : relatorias ,
' comissao ' : comissao ,
' comissao ' : comissao ,
@ -1453,10 +1433,7 @@ class TramitacaoForm(ModelForm):
Fieldset ( ' Incluir Tramitação ' ,
Fieldset ( ' Incluir Tramitação ' ,
row1 , row2 , row3 , row4 , row5 ,
row1 , row2 , row3 , row4 , row5 ,
) ,
) ,
ButtonHolder (
form_actions ( )
Submit ( ' submit ' , ' Salvar ' ,
css_class = ' button primary ' )
)
)
)
super ( TramitacaoForm , self ) . __init__ (
super ( TramitacaoForm , self ) . __init__ (
* args , * * kwargs )
* args , * * kwargs )
@ -1472,7 +1449,7 @@ class TramitacaoView(FormMixin, GenericView):
form = TramitacaoForm
form = TramitacaoForm
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' tramitacoes ' : tramitacoes } )
' tramitacoes ' : tramitacoes } )
@ -1498,7 +1475,7 @@ class TramitacaoView(FormMixin, GenericView):
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response (
return self . render_to_response (
{ ' form ' : form ,
{ ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' tramitacoes ' : tramitacoes_list } )
' tramitacoes ' : tramitacoes_list } )
corpo_email = ( ' A tramitação da matéria %s foi alterada. ' % materia
corpo_email = ( ' A tramitação da matéria %s foi alterada. ' % materia
@ -1514,7 +1491,7 @@ class TramitacaoView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response ( { ' form ' : form ,
return self . render_to_response ( { ' form ' : form ,
' materialegislativa ' : materia ,
' object ' : materia ,
' tramitacoes ' : tramitacoes_list } )
' tramitacoes ' : tramitacoes_list } )
def get_success_url ( self ) :
def get_success_url ( self ) :
@ -1531,7 +1508,7 @@ class TramitacaoEditView(FormMixin, GenericView):
form = TramitacaoForm
form = TramitacaoForm
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' tramitacao ' : tramitacao ,
' tramitacao ' : tramitacao ,
' turno ' : Tramitacao . TURNO_CHOICES ,
' turno ' : Tramitacao . TURNO_CHOICES ,
@ -1554,7 +1531,7 @@ class TramitacaoEditView(FormMixin, GenericView):
deletada ! '
deletada ! '
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' tramitacao ' : tramitacao ,
' tramitacao ' : tramitacao ,
' turno ' : Tramitacao . TURNO_CHOICES ,
' turno ' : Tramitacao . TURNO_CHOICES ,
@ -1576,7 +1553,7 @@ class TramitacaoEditView(FormMixin, GenericView):
return self . form_valid ( form )
return self . form_valid ( form )
else :
else :
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' tramitacao ' : tramitacao ,
' tramitacao ' : tramitacao ,
' turno ' : Tramitacao . TURNO_CHOICES ,
' turno ' : Tramitacao . TURNO_CHOICES ,
@ -1603,7 +1580,7 @@ class AutoriaView(GenericView):
form = AutoriaForm ( )
form = AutoriaForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1638,7 +1615,7 @@ class AutoriaView(GenericView):
autoria . save ( )
autoria . save ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1648,7 +1625,7 @@ class AutoriaView(GenericView):
msg = ' Essa autoria já foi adicionada! '
msg = ' Essa autoria já foi adicionada! '
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1656,7 +1633,7 @@ class AutoriaView(GenericView):
' tipo_autor_id ' : int ( form . data [ ' tipo_autor ' ] ) } )
' tipo_autor_id ' : int ( form . data [ ' tipo_autor ' ] ) } )
else :
else :
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1678,7 +1655,7 @@ class AutoriaEditView(GenericView):
form = AutoriaForm ( )
form = AutoriaForm ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1714,7 +1691,7 @@ class AutoriaEditView(GenericView):
autoria . save ( )
autoria . save ( )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1724,7 +1701,7 @@ class AutoriaEditView(GenericView):
msg = ' Essa autoria já foi adicionada! '
msg = ' Essa autoria já foi adicionada! '
messages . add_message ( request , messages . INFO , msg )
messages . add_message ( request , messages . INFO , msg )
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1732,7 +1709,7 @@ class AutoriaEditView(GenericView):
' tipo_autor_id ' : int ( form . data [ ' tipo_autor ' ] ) } )
' tipo_autor_id ' : int ( form . data [ ' tipo_autor ' ] ) } )
else :
else :
return self . render_to_response (
return self . render_to_response (
{ ' materialegislativa ' : materia ,
{ ' object ' : materia ,
' form ' : form ,
' form ' : form ,
' autorias ' : autorias ,
' autorias ' : autorias ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
' tipo_autores ' : TipoAutor . objects . all ( ) ,
@ -1792,11 +1769,7 @@ class ProposicaoForm(ModelForm):
[ ( ' texto_original ' , 10 ) ] )
[ ( ' texto_original ' , 10 ) ] )
row4 . append (
row4 . append (
Column (
Column ( form_actions ( ) , css_class = ' col-md-2 ' ) )
ButtonHolder (
Submit ( ' sumbmit ' , ' Salvar ' ,
css_class = ' button primary ' )
) , css_class = ' columns large-2 ' ) )
self . helper = FormHelper ( )
self . helper = FormHelper ( )
self . helper . layout = Layout (
self . helper . layout = Layout (
@ -1971,10 +1944,7 @@ class MateriaLegislativaPesquisaForm(forms.Form):
self . helper . layout = Layout (
self . helper . layout = Layout (
Fieldset ( ' Pesquisa Básica ' ,
Fieldset ( ' Pesquisa Básica ' ,
row1 , row2 , row3 , row4 , row5 , row6 , row7 ) ,
row1 , row2 , row3 , row4 , row5 , row6 , row7 ) ,
ButtonHolder (
form_actions ( save_label = ' Pesquisar ' )
Submit ( ' submit ' , ' Pesquisar ' ,
css_class = ' button primary ' )
)
)
)
super ( MateriaLegislativaPesquisaForm , self ) . __init__ (
super ( MateriaLegislativaPesquisaForm , self ) . __init__ (
* args , * * kwargs )
* args , * * kwargs )