Browse Source

Remove Vanilla Views do SAPL

pull/258/head
Edward Ribeiro 9 years ago
parent
commit
138ad7515c
  1. 5
      base/views.py
  2. 10
      comissoes/views.py
  3. 5
      norma/views.py
  4. 23
      parlamentares/views.py
  5. 12
      protocoloadm/views.py
  6. 1
      requirements/requirements.txt

5
base/views.py

@ -3,9 +3,8 @@ from functools import lru_cache
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.views.generic import FormView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django.views.generic.edit import FormMixin
from vanilla import GenericView
from .forms import CasaLegislativaTabelaAuxForm from .forms import CasaLegislativaTabelaAuxForm
from .models import CasaLegislativa from .models import CasaLegislativa
@ -23,7 +22,7 @@ class HelpView(TemplateView):
return ['ajuda/%s.html' % self.kwargs['topic']] return ['ajuda/%s.html' % self.kwargs['topic']]
class CasaLegislativaTableAuxView(FormMixin, GenericView): class CasaLegislativaTableAuxView(FormView):
template_name = "base/casa_leg_table_aux.html" template_name = "base/casa_leg_table_aux.html"

10
comissoes/views.py

@ -1,9 +1,7 @@
from django.contrib import messages from django.contrib import messages
from django.core.urlresolvers import reverse, reverse_lazy from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, ListView from django.views.generic import CreateView, FormView, ListView
from django.views.generic.edit import FormMixin
from vanilla import GenericView
from crud import Crud from crud import Crud
from materia.models import Tramitacao from materia.models import Tramitacao
@ -26,7 +24,7 @@ class CadastrarComissaoView(CreateView):
success_url = reverse_lazy('comissao:list') success_url = reverse_lazy('comissao:list')
class ComposicaoView(FormMixin, GenericView): class ComposicaoView(FormView):
template_name = 'comissoes/composicao.html' template_name = 'comissoes/composicao.html'
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -76,7 +74,7 @@ class ReunioesView(comissao_crud.CrudDetailView):
template_name = 'comissoes/reunioes.html' template_name = 'comissoes/reunioes.html'
class ComissaoParlamentarIncluirView(FormMixin, GenericView): class ComissaoParlamentarIncluirView(FormView):
template_name = "comissoes/comissao_parlamentar.html" template_name = "comissoes/comissao_parlamentar.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -129,7 +127,7 @@ class ComissaoParlamentarIncluirView(FormMixin, GenericView):
return reverse('comissao:composicao', kwargs={'pk': pk}) return reverse('comissao:composicao', kwargs={'pk': pk})
class ComissaoParlamentarEditView(FormMixin, GenericView): class ComissaoParlamentarEditView(FormView):
template_name = "comissoes/comissao_parlamentar_edit.html" template_name = "comissoes/comissao_parlamentar_edit.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):

5
norma/views.py

@ -5,8 +5,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.shortcuts import redirect from django.shortcuts import redirect
from django.views.generic import CreateView, ListView from django.views.generic import CreateView, FormView, ListView
from vanilla.views import GenericView
from compilacao.views import IntegracaoTaView from compilacao.views import IntegracaoTaView
from crud import Crud, make_pagination from crud import Crud, make_pagination
@ -23,7 +22,7 @@ norma_temporario_crud = Crud(NormaJuridica, 'normajuridica')
legislacao_citada_crud = Crud(LegislacaoCitada, '') legislacao_citada_crud = Crud(LegislacaoCitada, '')
class NormaPesquisaView(GenericView): class NormaPesquisaView(FormView):
template_name = "norma/pesquisa.html" template_name = "norma/pesquisa.html"
def get_success_url(self): def get_success_url(self):

23
parlamentares/views.py

@ -3,8 +3,7 @@ import os
from django.contrib import messages from django.contrib import messages
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic.edit import FormMixin from django.views.generic import FormView
from vanilla import GenericView
from crud import Crud from crud import Crud
@ -32,7 +31,7 @@ tipo_afastamento_crud = Crud(TipoAfastamento, 'tipo_afastamento')
tipo_militar_crud = Crud(SituacaoMilitar, 'tipo_situa_militar') tipo_militar_crud = Crud(SituacaoMilitar, 'tipo_situa_militar')
class ParlamentaresView(GenericView): class ParlamentaresView(FormView):
template_name = "parlamentares/parlamentares_list.html" template_name = "parlamentares/parlamentares_list.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -106,7 +105,7 @@ class ParlamentaresView(GenericView):
'parlamentares': parlamentares}) 'parlamentares': parlamentares})
class ParlamentaresCadastroView(FormMixin, GenericView): class ParlamentaresCadastroView(FormView):
template_name = "parlamentares/parlamentares_cadastro.html" template_name = "parlamentares/parlamentares_cadastro.html"
def get_success_url(self): def get_success_url(self):
@ -140,7 +139,7 @@ class ParlamentaresCadastroView(FormMixin, GenericView):
{'form': form, 'legislatura_id': pk}) {'form': form, 'legislatura_id': pk})
class ParlamentaresEditarView(FormMixin, GenericView): class ParlamentaresEditarView(FormView):
template_name = "parlamentares/parlamentares_cadastro.html" template_name = "parlamentares/parlamentares_cadastro.html"
def get_success_url(self): def get_success_url(self):
@ -181,7 +180,7 @@ class ParlamentaresEditarView(FormMixin, GenericView):
return self.render_to_response({'form': form}) return self.render_to_response({'form': form})
class ParlamentaresDependentesView(FormMixin, GenericView): class ParlamentaresDependentesView(FormView):
template_name = "parlamentares/parlamentares_dependentes.html" template_name = "parlamentares/parlamentares_dependentes.html"
@ -229,7 +228,7 @@ class ParlamentaresDependentesView(FormMixin, GenericView):
).legislatura.id}) ).legislatura.id})
class ParlamentaresDependentesEditView(FormMixin, GenericView): class ParlamentaresDependentesEditView(FormView):
template_name = "parlamentares/parlamentares_dependentes_edit.html" template_name = "parlamentares/parlamentares_dependentes_edit.html"
def get_success_url(self): def get_success_url(self):
@ -266,7 +265,7 @@ class ParlamentaresDependentesEditView(FormMixin, GenericView):
).legislatura_id}) ).legislatura_id})
class MesaDiretoraView(FormMixin, GenericView): class MesaDiretoraView(FormView):
template_name = "mesa_diretora/mesa_diretora.html" template_name = "mesa_diretora/mesa_diretora.html"
def get_success_url(self): 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" template_name = "parlamentares/parlamentares_filiacao.html"
def get_success_url(self): def get_success_url(self):
@ -500,7 +499,7 @@ class FiliacaoView(FormMixin, GenericView):
parlamentar, form, mensagem, request) parlamentar, form, mensagem, request)
class FiliacaoEditView(FormMixin, GenericView): class FiliacaoEditView(FormView):
template_name = "parlamentares/parlamentares_filiacao_edit.html" template_name = "parlamentares/parlamentares_filiacao_edit.html"
def get_success_url(self): def get_success_url(self):
@ -617,7 +616,7 @@ class FiliacaoEditView(FormMixin, GenericView):
).legislatura_id}) ).legislatura_id})
class MandatoView(FormMixin, GenericView): class MandatoView(FormView):
template_name = "parlamentares/parlamentares_mandato.html" template_name = "parlamentares/parlamentares_mandato.html"
def get_success_url(self): def get_success_url(self):
@ -664,7 +663,7 @@ class MandatoView(FormMixin, GenericView):
).legislatura.id}) ).legislatura.id})
class MandatoEditView(FormMixin, GenericView): class MandatoEditView(FormView):
template_name = "parlamentares/parlamentares_mandato_edit.html" template_name = "parlamentares/parlamentares_mandato_edit.html"
def get_success_url(self): def get_success_url(self):

12
protocoloadm/views.py

@ -11,8 +11,6 @@ from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, DetailView, FormView, ListView from django.views.generic import CreateView, DetailView, FormView, ListView
from django.views.generic.base import TemplateView 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 crud import Crud, make_pagination
from materia.models import Proposicao, TipoMateriaLegislativa from materia.models import Proposicao, TipoMateriaLegislativa
@ -488,7 +486,7 @@ class DetailDocumentoAdministrativo(DetailView):
'pk': self.kwargs['pk']}) 'pk': self.kwargs['pk']})
class DocumentoAcessorioAdministrativoEditView(FormMixin, GenericView): class DocumentoAcessorioAdministrativoEditView(FormView):
template_name = "protocoloadm/documento_acessorio_administrativo_edit.html" template_name = "protocoloadm/documento_acessorio_administrativo_edit.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -535,7 +533,7 @@ class DocumentoAcessorioAdministrativoEditView(FormMixin, GenericView):
return reverse('doc_ace_adm', kwargs={'pk': pk}) return reverse('doc_ace_adm', kwargs={'pk': pk})
class DocumentoAcessorioAdministrativoView(FormMixin, GenericView): class DocumentoAcessorioAdministrativoView(FormView):
template_name = "protocoloadm/documento_acessorio_administrativo.html" template_name = "protocoloadm/documento_acessorio_administrativo.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -574,7 +572,7 @@ class DocumentoAcessorioAdministrativoView(FormMixin, GenericView):
return reverse('doc_ace_adm', kwargs={'pk': pk}) return reverse('doc_ace_adm', kwargs={'pk': pk})
class TramitacaoAdmView(FormMixin, GenericView): class TramitacaoAdmView(FormView):
template_name = "protocoloadm/tramitacao.html" template_name = "protocoloadm/tramitacao.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -588,7 +586,7 @@ class TramitacaoAdmView(FormMixin, GenericView):
'tramitacoes': tramitacoes}) 'tramitacoes': tramitacoes})
class TramitacaoAdmIncluirView(FormMixin, GenericView): class TramitacaoAdmIncluirView(FormView):
template_name = "protocoloadm/tramitacao_incluir.html" template_name = "protocoloadm/tramitacao_incluir.html"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
@ -613,7 +611,7 @@ class TramitacaoAdmIncluirView(FormMixin, GenericView):
return self.form_invalid(form) return self.form_invalid(form)
class TramitacaoAdmEditView(FormMixin, GenericView): class TramitacaoAdmEditView(FormView):
template_name = "protocoloadm/tramitacao_edit.html" template_name = "protocoloadm/tramitacao_edit.html"

1
requirements/requirements.txt

@ -8,7 +8,6 @@ django-crispy-forms==1.6.0
django-extra-views==0.7.1 django-extra-views==0.7.1
django-model-utils==2.4 django-model-utils==2.4
django-sass-processor==0.3.4 django-sass-processor==0.3.4
django-vanilla-views==1.0.4
django==1.9 django==1.9
djangorestframework djangorestframework
git+git://github.com/interlegis/trml2pdf.git git+git://github.com/interlegis/trml2pdf.git

Loading…
Cancel
Save