From 9009ffab4e08d61e3445b2a62ab5a2aaf5d52ae0 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 16 Jul 2015 16:31:03 -0300 Subject: [PATCH] Add boostrap button and url ref --- sessao/urls.py | 10 +++++----- sessao/views.py | 3 +++ templates/sessao/sessaoplenaria_form.html | 1 + templates/sessao/sessaoplenaria_list.html | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sessao/urls.py b/sessao/urls.py index e4e33ad2a..7f80e11b3 100644 --- a/sessao/urls.py +++ b/sessao/urls.py @@ -4,9 +4,9 @@ from sessao.views import SessaoPlenariaListView, SessaoPlenariaDetailView, Sessa urlpatterns = patterns( - 'comissoes.views', - url(r'^$', SessaoPlenariaListView.as_view(), name='sessaoplenaria_list'), - url(r'^(?P\d+)$', SessaoPlenariaDetailView.as_view(), name='sessaoplenaria_detail'), - url(r'^add$', SessaoPlenariaCreateView.as_view(), name='sessaoplenaria_update'), - url(r'^(?P\d+)/edit$', SessaoPlenariaUpdateView.as_view(), name='sessaoplenaria_update'), + 'sessao.views', + url(r'^$', SessaoPlenariaListView.as_view(), name='sessao_list'), + url(r'^(?P\d+)$', SessaoPlenariaDetailView.as_view(), name='sessao_detail'), + url(r'^create$', SessaoPlenariaCreateView.as_view(), name='sessao_create'), + url(r'^(?P\d+)/edit$', SessaoPlenariaUpdateView.as_view(), name='sessao_update'), ) diff --git a/sessao/views.py b/sessao/views.py index 219659885..124ded6b7 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -16,6 +16,9 @@ class SessaoPlenariaDetailView(DetailView): class SessaoPlenariaCreateView(CreateView): model = SessaoPlenaria fields = [f.name for f in SessaoPlenaria._meta.fields] + + 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 d979fcbc2..7f58bb165 100644 --- a/templates/sessao/sessaoplenaria_form.html +++ b/templates/sessao/sessaoplenaria_form.html @@ -7,6 +7,7 @@

Sessão Legislativa

+ Voltar {# Display a form #}
diff --git a/templates/sessao/sessaoplenaria_list.html b/templates/sessao/sessaoplenaria_list.html index ae80b5802..07639ad2e 100644 --- a/templates/sessao/sessaoplenaria_list.html +++ b/templates/sessao/sessaoplenaria_list.html @@ -6,8 +6,8 @@ {% block content %}

Sessão Legislativa

- Incluir Sessão - + Incluir Sessão +