Browse Source

Fix qa_check alerts

pull/98/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
e292cb51c2
  1. 19
      base/models.py
  2. 4
      base/urls.py
  3. 12
      base/views.py
  4. 5
      comissoes/urls.py
  5. 76
      comissoes/views.py
  6. 3
      materia/views.py
  7. 2
      sapl/context_processors.py
  8. 3
      sessao/urls.py

19
base/models.py

@ -1,6 +1,7 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
def get_sessao_media_path(instance, subpath, filename):
return './casa/%s/%s/%s' % (instance.codigo, subpath, filename)
@ -8,6 +9,7 @@ def get_sessao_media_path(instance, subpath, filename):
def get_casa_media_path(instance, filename):
return get_sessao_media_path(instance, 'Logotipo', filename)
class CasaLegislativa(models.Model):
# TODO ajustar todos os max_length !!!!
# cod_casa => id (pk)
@ -19,17 +21,24 @@ class CasaLegislativa(models.Model):
cep = models.CharField(max_length=100, verbose_name=_('CEP'))
municipio = models.CharField(max_length=100, verbose_name=_('Município'))
uf = models.CharField(max_length=100, verbose_name=_('UF'))
telefone = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Telefone'))
fax = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Fax'))
telefone = models.CharField(
max_length=100, blank=True, null=True, verbose_name=_('Telefone'))
fax = models.CharField(
max_length=100, blank=True, null=True, verbose_name=_('Fax'))
logotipo = models.ImageField(
blank=True,
null=True,
upload_to=get_casa_media_path,
verbose_name=_('Logotipo'))
endereco_web = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('HomePage'))
email = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('E-mail'))
endereco_web = models.CharField(
max_length=100, blank=True, null=True, verbose_name=_('HomePage'))
email = models.CharField(
max_length=100, blank=True, null=True, verbose_name=_('E-mail'))
informacao_geral = models.CharField(
max_length=100, blank=True, null=True, verbose_name=_('Informação Geral'))
max_length=100,
blank=True,
null=True,
verbose_name=_('Informação Geral'))
class Meta:
verbose_name = _('Casa Legislativa')

4
base/urls.py

@ -1,8 +1,7 @@
from django.conf.urls import url
from django.views.generic.base import TemplateView
from .views import HelpView, CasaLegislativaTableAuxView
from .views import CasaLegislativaTableAuxView, HelpView
urlpatterns = [
url(r'^sistema/', TemplateView.as_view(template_name='sistema.html')),
@ -11,5 +10,4 @@ urlpatterns = [
name='help_base'),
url(r'^casa-legislativa$',
CasaLegislativaTableAuxView.as_view(), name='casa_legislativa'),
]

12
base/views.py

@ -1,6 +1,5 @@
import sapl
from crispy_forms.helper import FormHelper
from crispy_forms.layout import ButtonHolder, HTML, Fieldset, Layout, Submit
from crispy_forms.layout import HTML, ButtonHolder, Fieldset, Layout, Submit
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
@ -9,9 +8,9 @@ from django.views.generic.base import TemplateView
from django.views.generic.edit import FormMixin
from vanilla import GenericView
from .models import CasaLegislativa
import sapl
from sapl import settings
from .models import CasaLegislativa
class HelpView(TemplateView):
@ -60,7 +59,6 @@ class CasaLegislativaTabelaAuxForm(ModelForm):
widget=forms.Select(
attrs={'class': 'selector'}))
informacao_geral = forms.CharField(widget=forms.Textarea,
label='Informação Geral',
required=False)
@ -177,7 +175,9 @@ class CasaLegislativaTableAuxView(FormMixin, GenericView):
casa_save = form.save(commit=False)
else:
casa_save = CasaLegislativaTabelaAuxForm(
request.POST, request.FILES, instance=casa).save(commit=False)
request.POST,
request.FILES,
instance=casa).save(commit=False)
casa_save.save()
return self.form_valid(form)
else:

5
comissoes/urls.py

@ -1,10 +1,11 @@
from django.conf.urls import include, url
from comissoes.views import (ComissaoParlamentarEditView,
from comissoes.views import (CadastrarComissaoView,
ComissaoParlamentarEditView,
ComissaoParlamentarIncluirView, ComposicaoView,
MateriasView, ReunioesView, cargo_crud,
comissao_crud, periodo_composicao_crud,
tipo_comissao_crud,CadastrarComissaoView)
tipo_comissao_crud)
comissao_url_patterns = comissao_crud.urlpatterns + [
url(r'^(?P<pk>\d+)/composicao$',

76
comissoes/views.py

@ -1,5 +1,5 @@
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit, MultiField, Div, Field
from crispy_forms.layout import ButtonHolder, Fieldset, Layout, Submit
from django import forms
from django.core.urlresolvers import reverse
from django.forms import ModelForm
@ -7,7 +7,6 @@ from django.utils.translation import ugettext_lazy as _
from django.views.generic.edit import FormMixin
from vanilla import GenericView
import sapl
from parlamentares.models import Filiacao, Parlamentar
from sapl.crud import build_crud
@ -67,7 +66,6 @@ comissao_crud = build_crud(
class CadastrarComissaoForm(ModelForm):
class Meta:
model = Comissao
@ -103,61 +101,60 @@ class CadastrarComissaoForm(ModelForm):
row2 = sapl.layout.to_row(
[('tipo', 3),
('data_criacao', 3),
('unidade_deliberativa',3),
('data_extincao',3)])
('unidade_deliberativa', 3),
('data_extincao', 3)])
row3 = sapl.layout.to_row(
[('local_reuniao',4),
('agenda_reuniao',4),
('telefone_reuniao',4)])
[('local_reuniao', 4),
('agenda_reuniao', 4),
('telefone_reuniao', 4)])
row4 = sapl.layout.to_row(
[('endereco_secretaria', 4),
('telefone_secretaria', 4),
('fax_secretaria', 4)])
('telefone_secretaria', 4),
('fax_secretaria', 4)])
row5 = sapl.layout.to_row(
[('secretario',6),
('email',6)])
[('secretario', 6),
('email', 6)])
row6 = sapl.layout.to_row(
[('finalidade', 12)])
row7 = sapl.layout.to_row(
[('apelido_temp', 9),
('data_instalacao_temp',3)])
('data_instalacao_temp', 3)])
row8 = sapl.layout.to_row(
[('data_final_prevista_temp',4),
('data_prorrogada_temp',4),
('data_fim_comissao',4)])
[('data_final_prevista_temp', 4),
('data_prorrogada_temp', 4),
('data_fim_comissao', 4)])
self.helper = FormHelper()
self.helper.layout = Layout(
Fieldset(
'Cadastrar Comissão',
Fieldset(
'Dados Básicos',
row1,
row2
),
Fieldset(
'Dados Complementares',
row3,
row4,
row5,
row6
),
Fieldset(
'Temporária',
row7,
row8
),
ButtonHolder(
Submit('submit', 'Salvar',
css_class='button primary')
)
'Cadastrar Comissão',
Fieldset(
'Dados Básicos',
row1,
row2
),
Fieldset(
'Dados Complementares',
row3,
row4,
row5,
row6
),
Fieldset(
'Temporária',
row7,
row8
),
ButtonHolder(
Submit('submit', 'Salvar',
css_class='button primary')
)
)
)
super(CadastrarComissaoForm, self).__init__(*args, **kwargs)
@ -187,7 +184,6 @@ class CadastrarComissaoView(FormMixin, GenericView):
return reverse('comissao:list')
class ComposicaoForm(forms.Form):
periodo = forms.CharField()

3
materia/views.py

@ -2,8 +2,7 @@ from datetime import date, datetime
from re import sub
from crispy_forms.helper import FormHelper
from crispy_forms.layout import (HTML, ButtonHolder, Column, Fieldset, Layout,
Submit)
from crispy_forms.layout import ButtonHolder, Column, Fieldset, Layout, Submit
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse

2
sapl/context_processors.py

@ -29,4 +29,4 @@ def parliament_info(request):
context['state'] = casa_legislativa.uf
context['logotipo'] = casa_legislativa.logotipo
return context;
return context

3
sessao/urls.py

@ -1,5 +1,6 @@
from django.conf.urls import include, url
from sapl import settings
from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView,
ExpedienteOrdemDiaView, ExpedienteView,
ExplicacaoDelete, ExplicacaoEdit, ExplicacaoView,
@ -17,8 +18,6 @@ from sessao.views import (EditExpedienteOrdemDiaView, EditMateriaOrdemDiaView,
VotacaoView, sessao_crud, tipo_expediente_crud,
tipo_resultado_votacao_crud, tipo_sessao_crud)
from sapl import settings
urlpatterns_sessao = sessao_crud.urlpatterns + [
url(r'^(?P<pk>\d+)/expediente$',
ExpedienteView.as_view(), name='expediente'),

Loading…
Cancel
Save