diff --git a/base/views.py b/base/views.py index a04a3e700..77335d269 100644 --- a/base/views.py +++ b/base/views.py @@ -3,9 +3,8 @@ from functools import lru_cache from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse +from django.views.generic import FormView from django.views.generic.base import TemplateView -from django.views.generic.edit import FormMixin -from vanilla import GenericView from .forms import CasaLegislativaTabelaAuxForm from .models import CasaLegislativa @@ -23,7 +22,7 @@ class HelpView(TemplateView): return ['ajuda/%s.html' % self.kwargs['topic']] -class CasaLegislativaTableAuxView(FormMixin, GenericView): +class CasaLegislativaTableAuxView(FormView): template_name = "base/casa_leg_table_aux.html" diff --git a/comissoes/views.py b/comissoes/views.py index c38bc66c8..11e6d7ac6 100644 --- a/comissoes/views.py +++ b/comissoes/views.py @@ -1,9 +1,7 @@ from django.contrib import messages from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ -from django.views.generic import CreateView, ListView -from django.views.generic.edit import FormMixin -from vanilla import GenericView +from django.views.generic import CreateView, FormView, ListView from crud import Crud from materia.models import Tramitacao @@ -26,7 +24,7 @@ class CadastrarComissaoView(CreateView): success_url = reverse_lazy('comissao:list') -class ComposicaoView(FormMixin, GenericView): +class ComposicaoView(FormView): template_name = 'comissoes/composicao.html' def get(self, request, *args, **kwargs): @@ -76,7 +74,7 @@ class ReunioesView(comissao_crud.CrudDetailView): template_name = 'comissoes/reunioes.html' -class ComissaoParlamentarIncluirView(FormMixin, GenericView): +class ComissaoParlamentarIncluirView(FormView): template_name = "comissoes/comissao_parlamentar.html" def get(self, request, *args, **kwargs): @@ -129,7 +127,7 @@ class ComissaoParlamentarIncluirView(FormMixin, GenericView): return reverse('comissao:composicao', kwargs={'pk': pk}) -class ComissaoParlamentarEditView(FormMixin, GenericView): +class ComissaoParlamentarEditView(FormView): template_name = "comissoes/comissao_parlamentar_edit.html" def get(self, request, *args, **kwargs): diff --git a/norma/views.py b/norma/views.py index 4213cf207..46c6b4b82 100644 --- a/norma/views.py +++ b/norma/views.py @@ -5,8 +5,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import redirect -from django.views.generic import CreateView, ListView -from vanilla.views import GenericView +from django.views.generic import CreateView, FormView, ListView from compilacao.views import IntegracaoTaView from crud import Crud, make_pagination @@ -23,7 +22,7 @@ norma_temporario_crud = Crud(NormaJuridica, 'normajuridica') legislacao_citada_crud = Crud(LegislacaoCitada, '') -class NormaPesquisaView(GenericView): +class NormaPesquisaView(FormView): template_name = "norma/pesquisa.html" def get_success_url(self): diff --git a/parlamentares/views.py b/parlamentares/views.py index 9a0ad9662..b6803f182 100644 --- a/parlamentares/views.py +++ b/parlamentares/views.py @@ -3,8 +3,7 @@ import os from django.contrib import messages from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ -from django.views.generic.edit import FormMixin -from vanilla import GenericView +from django.views.generic import FormView from crud import Crud @@ -32,7 +31,7 @@ tipo_afastamento_crud = Crud(TipoAfastamento, 'tipo_afastamento') tipo_militar_crud = Crud(SituacaoMilitar, 'tipo_situa_militar') -class ParlamentaresView(GenericView): +class ParlamentaresView(FormView): template_name = "parlamentares/parlamentares_list.html" def get(self, request, *args, **kwargs): @@ -106,7 +105,7 @@ class ParlamentaresView(GenericView): 'parlamentares': parlamentares}) -class ParlamentaresCadastroView(FormMixin, GenericView): +class ParlamentaresCadastroView(FormView): template_name = "parlamentares/parlamentares_cadastro.html" def get_success_url(self): @@ -140,7 +139,7 @@ class ParlamentaresCadastroView(FormMixin, GenericView): {'form': form, 'legislatura_id': pk}) -class ParlamentaresEditarView(FormMixin, GenericView): +class ParlamentaresEditarView(FormView): template_name = "parlamentares/parlamentares_cadastro.html" def get_success_url(self): @@ -181,7 +180,7 @@ class ParlamentaresEditarView(FormMixin, GenericView): return self.render_to_response({'form': form}) -class ParlamentaresDependentesView(FormMixin, GenericView): +class ParlamentaresDependentesView(FormView): template_name = "parlamentares/parlamentares_dependentes.html" @@ -229,7 +228,7 @@ class ParlamentaresDependentesView(FormMixin, GenericView): ).legislatura.id}) -class ParlamentaresDependentesEditView(FormMixin, GenericView): +class ParlamentaresDependentesEditView(FormView): template_name = "parlamentares/parlamentares_dependentes_edit.html" def get_success_url(self): @@ -266,7 +265,7 @@ class ParlamentaresDependentesEditView(FormMixin, GenericView): ).legislatura_id}) -class MesaDiretoraView(FormMixin, GenericView): +class MesaDiretoraView(FormView): template_name = "mesa_diretora/mesa_diretora.html" def get_success_url(self): @@ -381,7 +380,7 @@ class MesaDiretoraView(FormMixin, GenericView): }) -class FiliacaoView(FormMixin, GenericView): +class FiliacaoView(FormView): template_name = "parlamentares/parlamentares_filiacao.html" def get_success_url(self): @@ -500,7 +499,7 @@ class FiliacaoView(FormMixin, GenericView): parlamentar, form, mensagem, request) -class FiliacaoEditView(FormMixin, GenericView): +class FiliacaoEditView(FormView): template_name = "parlamentares/parlamentares_filiacao_edit.html" def get_success_url(self): @@ -617,7 +616,7 @@ class FiliacaoEditView(FormMixin, GenericView): ).legislatura_id}) -class MandatoView(FormMixin, GenericView): +class MandatoView(FormView): template_name = "parlamentares/parlamentares_mandato.html" def get_success_url(self): @@ -664,7 +663,7 @@ class MandatoView(FormMixin, GenericView): ).legislatura.id}) -class MandatoEditView(FormMixin, GenericView): +class MandatoEditView(FormView): template_name = "parlamentares/parlamentares_mandato_edit.html" def get_success_url(self): diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 4f8f1b39a..f1299ae6d 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -11,8 +11,6 @@ from django.utils.html import strip_tags from django.utils.translation import ugettext_lazy as _ from django.views.generic import CreateView, DetailView, FormView, ListView from django.views.generic.base import TemplateView -from django.views.generic.edit import FormMixin -from vanilla import GenericView from crud import Crud, make_pagination from materia.models import Proposicao, TipoMateriaLegislativa @@ -488,7 +486,7 @@ class DetailDocumentoAdministrativo(DetailView): 'pk': self.kwargs['pk']}) -class DocumentoAcessorioAdministrativoEditView(FormMixin, GenericView): +class DocumentoAcessorioAdministrativoEditView(FormView): template_name = "protocoloadm/documento_acessorio_administrativo_edit.html" def get(self, request, *args, **kwargs): @@ -535,7 +533,7 @@ class DocumentoAcessorioAdministrativoEditView(FormMixin, GenericView): return reverse('doc_ace_adm', kwargs={'pk': pk}) -class DocumentoAcessorioAdministrativoView(FormMixin, GenericView): +class DocumentoAcessorioAdministrativoView(FormView): template_name = "protocoloadm/documento_acessorio_administrativo.html" def get(self, request, *args, **kwargs): @@ -574,7 +572,7 @@ class DocumentoAcessorioAdministrativoView(FormMixin, GenericView): return reverse('doc_ace_adm', kwargs={'pk': pk}) -class TramitacaoAdmView(FormMixin, GenericView): +class TramitacaoAdmView(FormView): template_name = "protocoloadm/tramitacao.html" def get(self, request, *args, **kwargs): @@ -588,7 +586,7 @@ class TramitacaoAdmView(FormMixin, GenericView): 'tramitacoes': tramitacoes}) -class TramitacaoAdmIncluirView(FormMixin, GenericView): +class TramitacaoAdmIncluirView(FormView): template_name = "protocoloadm/tramitacao_incluir.html" def get(self, request, *args, **kwargs): @@ -613,7 +611,7 @@ class TramitacaoAdmIncluirView(FormMixin, GenericView): return self.form_invalid(form) -class TramitacaoAdmEditView(FormMixin, GenericView): +class TramitacaoAdmEditView(FormView): template_name = "protocoloadm/tramitacao_edit.html" diff --git a/requirements/requirements.txt b/requirements/requirements.txt index b9ba22ef5..293ef60ca 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -8,7 +8,6 @@ django-crispy-forms==1.6.0 django-extra-views==0.7.1 django-model-utils==2.4 django-sass-processor==0.3.4 -django-vanilla-views==1.0.4 django==1.9 djangorestframework git+git://github.com/interlegis/trml2pdf.git