diff --git a/sessao/forms.py b/sessao/forms.py index 1de73c54f..2e73289fd 100644 --- a/sessao/forms.py +++ b/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)]], + ) diff --git a/sessao/views.py b/sessao/views.py index 124ded6b7..32288ebef 100644 --- a/sessao/views.py +++ b/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') diff --git a/templates/sessao/sessaoplenaria_form.html b/templates/sessao/sessaoplenaria_form.html index c9d344964..db41368d1 100644 --- a/templates/sessao/sessaoplenaria_form.html +++ b/templates/sessao/sessaoplenaria_form.html @@ -1,11 +1,10 @@ {% extends "base.html" %} - {% load i18n bootstrap3 crispy_forms_tags %} {% block title %}SAPL{% endblock %} {% block content %} -
+
{% crispy form %}
{% endblock %} \ No newline at end of file