Browse Source

Fix Sessao Plenaria view for crispy form

pull/6/head
Edward Ribeiro 10 years ago
parent
commit
e714cbe113
  1. 14
      sessao/forms.py
  2. 8
      sessao/views.py
  3. 3
      templates/sessao/sessaoplenaria_form.html

14
sessao/forms.py

@ -38,17 +38,17 @@ class SessaoPlenariaForm(forms.ModelForm):
[_('Dados Básicos'),
[('numero', 3),
('tip_sessao_plen_FIXME', 3),
('tipo', 3),
('legislatura', 3),
('sessao_leg_FIXME', 3)],
('sessao_legislativa', 3)],
[('data_inicio', 12)],
[('data_fim', 12)],
[('file_pauta_FIXME', 3),
('file_ata_FIXME', 3),
('url_audio', 3),
('url_video', 3)],
[('url_audio', 6), ('url_video', 6)],
[('dia',2),
('hora_inicio',2),
('hora_fim',2),
('tipo_expediente',6)],
[('url_audio', 6), ('url_video', 6)]],
)

8
sessao/views.py

@ -3,7 +3,7 @@ from django.core.urlresolvers import reverse_lazy
from django.views.generic import CreateView, DeleteView, ListView, UpdateView, DetailView
from sessao.models import SessaoPlenaria
from .forms import SessaoPlenariaForm
class SessaoPlenariaListView(ListView):
model = SessaoPlenaria
@ -15,10 +15,10 @@ class SessaoPlenariaDetailView(DetailView):
class SessaoPlenariaCreateView(CreateView):
model = SessaoPlenaria
fields = [f.name for f in SessaoPlenaria._meta.fields]
# fields = [f.name for f in SessaoPlenaria._meta.fields]
form_class = SessaoPlenariaForm
form_invalid_message = u"Something went wrong, post was not saved"
success_url = reverse_lazy('sessao_list')

3
templates/sessao/sessaoplenaria_form.html

@ -1,11 +1,10 @@
{% extends "base.html" %}
{% load i18n bootstrap3 crispy_forms_tags %}
{% block title %}SAPL{% endblock %}
{% block content %}
<div id="content-main">
<div id="content-main">
{% crispy form %}
</div>
{% endblock %}
Loading…
Cancel
Save