|
|
@ -2,12 +2,12 @@ from datetime import datetime |
|
|
|
from random import choice |
|
|
|
from string import ascii_letters, digits |
|
|
|
|
|
|
|
from braces.views import PermissionRequiredMixin |
|
|
|
from crispy_forms.helper import FormHelper |
|
|
|
from crispy_forms.layout import HTML, Button |
|
|
|
from django.conf import settings |
|
|
|
from django.contrib import messages |
|
|
|
from django.contrib.auth import get_user_model |
|
|
|
from django.contrib.auth.mixins import PermissionRequiredMixin |
|
|
|
from django.contrib.auth.tokens import default_token_generator |
|
|
|
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist |
|
|
|
from django.core.mail import send_mail |
|
|
@ -26,24 +26,20 @@ from django_filters.views import FilterView |
|
|
|
from sapl.base.models import CasaLegislativa |
|
|
|
from sapl.compilacao.views import IntegracaoTaView |
|
|
|
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row |
|
|
|
from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, |
|
|
|
CrudDeleteView, CrudDetailView, CrudListView, |
|
|
|
CrudUpdateView, MasterDetailCrud, make_pagination) |
|
|
|
from sapl.crud.base import (RP_DETAIL, RP_LIST, Crud, CrudAux, CrudDetailView, |
|
|
|
MasterDetailCrud, make_pagination) |
|
|
|
from sapl.materia.forms import AnexadaForm |
|
|
|
from sapl.norma.models import LegislacaoCitada |
|
|
|
from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, |
|
|
|
autor_modal, gerar_hash_arquivo, get_base_url, |
|
|
|
permissao_tb_aux, permissoes_autor, permissoes_materia, |
|
|
|
permissoes_autor, permissoes_materia, |
|
|
|
permissoes_protocoloadm) |
|
|
|
|
|
|
|
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, |
|
|
|
AnexadaForm, AutorForm, AutoriaForm, |
|
|
|
ConfirmarProposicaoForm, DespachoInicialForm, |
|
|
|
DocumentoAcessorioForm, LegislacaoCitadaForm, |
|
|
|
MateriaLegislativaFilterSet, NumeracaoForm, |
|
|
|
AutorForm, ConfirmarProposicaoForm, DocumentoAcessorioForm, |
|
|
|
MateriaLegislativaFilterSet, |
|
|
|
PrimeiraTramitacaoEmLoteFilterSet, ProposicaoForm, |
|
|
|
ReceberProposicaoForm, RelatoriaForm, |
|
|
|
TramitacaoEmLoteFilterSet, TramitacaoForm, |
|
|
|
TramitacaoUpdateForm, UnidadeTramitacaoForm, |
|
|
|
ReceberProposicaoForm, TramitacaoEmLoteFilterSet, |
|
|
|
filtra_tramitacao_destino, |
|
|
|
filtra_tramitacao_destino_and_status, |
|
|
|
filtra_tramitacao_status) |
|
|
@ -54,8 +50,26 @@ from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria, |
|
|
|
TipoFimRelatoria, TipoMateriaLegislativa, TipoProposicao, |
|
|
|
Tramitacao, UnidadeTramitacao) |
|
|
|
|
|
|
|
|
|
|
|
AnexadaCrud = Crud.build(Anexada, '') |
|
|
|
|
|
|
|
OrigemCrud = Crud.build(Origem, '') |
|
|
|
|
|
|
|
TipoMateriaCrud = CrudAux.build( |
|
|
|
TipoMateriaLegislativa, 'tipo_materia_legislativa') |
|
|
|
|
|
|
|
RegimeTramitacaoCrud = CrudAux.build( |
|
|
|
RegimeTramitacao, 'regime_tramitacao') |
|
|
|
|
|
|
|
TipoDocumentoCrud = CrudAux.build( |
|
|
|
TipoDocumento, 'tipo_documento') |
|
|
|
|
|
|
|
TipoFimRelatoriaCrud = CrudAux.build( |
|
|
|
TipoFimRelatoria, 'fim_relatoria') |
|
|
|
|
|
|
|
TipoAutorCrud = CrudAux.build( |
|
|
|
TipoAutor, 'regime_tramitacao') |
|
|
|
|
|
|
|
|
|
|
|
def recuperar_materia(request): |
|
|
|
tipo = TipoMateriaLegislativa.objects.get(pk=request.GET['tipo']) |
|
|
@ -69,61 +83,6 @@ def recuperar_materia(request): |
|
|
|
return response |
|
|
|
|
|
|
|
|
|
|
|
class OrigemCrud(Crud): |
|
|
|
model = Origem |
|
|
|
help_path = 'origem' |
|
|
|
|
|
|
|
|
|
|
|
class TipoMateriaCrud(Crud): |
|
|
|
model = TipoMateriaLegislativa |
|
|
|
help_path = 'tipo_materia_legislativa' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
class RegimeTramitacaoCrud(Crud): |
|
|
|
model = RegimeTramitacao |
|
|
|
help_path = 'regime_tramitacao' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
class TipoDocumentoCrud(Crud): |
|
|
|
model = TipoDocumento |
|
|
|
help_path = 'tipo_documento' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
class TipoFimRelatoriaCrud(Crud): |
|
|
|
model = TipoFimRelatoria |
|
|
|
help_path = 'fim_relatoria' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
class TipoAutorCrud(Crud): |
|
|
|
model = TipoAutor |
|
|
|
help_path = 'tipo_autor' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
def montar_helper_autor(self): |
|
|
|
autor_row = montar_row_autor('nome') |
|
|
|
self.helper = FormHelper() |
|
|
@ -146,18 +105,14 @@ def montar_helper_autor(self): |
|
|
|
' class="btn btn-inverse">Cancelar</a>')])) |
|
|
|
|
|
|
|
|
|
|
|
class AutorCrud(Crud): |
|
|
|
class AutorCrud(CrudAux): |
|
|
|
model = Autor |
|
|
|
help_path = 'autor' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
class BaseMixin(CrudAux.BaseMixin): |
|
|
|
list_field_names = ['tipo', 'nome'] |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
class UpdateView(CrudUpdateView): |
|
|
|
form_class = AutorForm |
|
|
|
class UpdateView(CrudAux.UpdateView): |
|
|
|
layout_key = 'AutorCreate' |
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
@ -169,7 +124,7 @@ class AutorCrud(Crud): |
|
|
|
context['helper'] = self.helper |
|
|
|
return context |
|
|
|
|
|
|
|
class CreateView(CrudCreateView): |
|
|
|
class CreateView(CrudAux.CreateView): |
|
|
|
form_class = AutorForm |
|
|
|
layout_key = 'AutorCreate' |
|
|
|
|
|
|
@ -223,34 +178,10 @@ class ConfirmarEmailView(TemplateView): |
|
|
|
return self.render_to_response(context) |
|
|
|
|
|
|
|
|
|
|
|
class OrgaoCrud(Crud): |
|
|
|
model = Orgao |
|
|
|
help_path = 'orgao' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
class TipoProposicaoCrud(Crud): |
|
|
|
model = TipoProposicao |
|
|
|
help_path = 'tipo_proposicao' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
|
|
|
|
|
|
|
|
class StatusTramitacaoCrud(Crud): |
|
|
|
model = StatusTramitacao |
|
|
|
help_path = 'status_tramitacao' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
return permissao_tb_aux(self) |
|
|
|
OrgaoCrud = CrudAux.build(Orgao, 'orgao') |
|
|
|
TipoProposicaoCrud = CrudAux.build(TipoProposicao, 'tipo_proposicao') |
|
|
|
StatusTramitacaoCrud = CrudAux.build(StatusTramitacao, 'status_tramitacao') |
|
|
|
UnidadeTramitacaoCrud = CrudAux.build(UnidadeTramitacao, 'unidade_tramitacao') |
|
|
|
|
|
|
|
|
|
|
|
def criar_materia_proposicao(proposicao): |
|
|
@ -290,22 +221,6 @@ def criar_doc_proposicao(proposicao): |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
class UnidadeTramitacaoCrud(Crud): |
|
|
|
model = UnidadeTramitacao |
|
|
|
help_path = 'unidade_tramitacao' |
|
|
|
|
|
|
|
class CreateView(CrudCreateView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
form_class = UnidadeTramitacaoForm |
|
|
|
|
|
|
|
class UpdateView(CrudUpdateView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
form_class = UnidadeTramitacaoForm |
|
|
|
|
|
|
|
class DeleteView(CrudDeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
class ProposicaoDevolvida(PermissionRequiredMixin, ListView): |
|
|
|
template_name = 'materia/prop_devolvidas_list.html' |
|
|
|
model = Proposicao |
|
|
@ -451,13 +366,12 @@ class ProposicaoCrud(Crud): |
|
|
|
model = Proposicao |
|
|
|
help_path = '' |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
class BaseMixin(Crud.BaseMixin): |
|
|
|
list_field_names = ['data_envio', 'descricao', |
|
|
|
'tipo', 'data_recebimento'] |
|
|
|
|
|
|
|
class CreateView(CrudCreateView): |
|
|
|
class CreateView(Crud.CreateView): |
|
|
|
form_class = ProposicaoForm |
|
|
|
permission_required = {'materia.add_proposicao'} |
|
|
|
|
|
|
|
@property |
|
|
|
def layout_key(self): |
|
|
@ -483,9 +397,8 @@ class ProposicaoCrud(Crud): |
|
|
|
else: |
|
|
|
return {'autor': autor_id} |
|
|
|
|
|
|
|
class UpdateView(CrudUpdateView): |
|
|
|
class UpdateView(Crud.UpdateView): |
|
|
|
form_class = ProposicaoForm |
|
|
|
permission_required = permissoes_autor() |
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
initial = self.initial.copy() |
|
|
@ -519,8 +432,7 @@ class ProposicaoCrud(Crud): |
|
|
|
messages.add_message(self.request, messages.ERROR, msg) |
|
|
|
return False |
|
|
|
|
|
|
|
class DetailView(CrudDetailView): |
|
|
|
permission_required = permissoes_autor() |
|
|
|
class DetailView(Crud.DetailView): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
perms = self.get_permission_required() |
|
|
@ -536,9 +448,8 @@ class ProposicaoCrud(Crud): |
|
|
|
context['subnav_template_name'] = '' |
|
|
|
return context |
|
|
|
|
|
|
|
class ListView(CrudListView): |
|
|
|
class ListView(Crud.ListView): |
|
|
|
ordering = ['-data_envio', 'descricao'] |
|
|
|
permission_required = permissoes_autor() |
|
|
|
|
|
|
|
def get_rows(self, object_list): |
|
|
|
|
|
|
@ -566,8 +477,7 @@ class ProposicaoCrud(Crud): |
|
|
|
|
|
|
|
return lista |
|
|
|
|
|
|
|
class DeleteView(CrudDeleteView): |
|
|
|
permission_required = {'materia.delete_proposicao'} |
|
|
|
class DeleteView(Crud.DeleteView): |
|
|
|
|
|
|
|
def has_permission(self): |
|
|
|
perms = self.get_permission_required() |
|
|
@ -630,10 +540,9 @@ class RelatoriaCrud(MasterDetailCrud): |
|
|
|
model = Relatoria |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
form_class = RelatoriaForm |
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
materia = MateriaLegislativa.objects.get(id=self.kwargs['pk']) |
|
|
@ -652,27 +561,20 @@ class RelatoriaCrud(MasterDetailCrud): |
|
|
|
|
|
|
|
return {'comissao': localizacao} |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
form_class = RelatoriaForm |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
class TramitacaoCrud(MasterDetailCrud): |
|
|
|
model = Tramitacao |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
class BaseMixin(MasterDetailCrud.BaseMixin): |
|
|
|
list_field_names = ['data_tramitacao', 'unidade_tramitacao_local', |
|
|
|
'unidade_tramitacao_destino', 'status'] |
|
|
|
ordered_list = False |
|
|
|
ordering = '-data_tramitacao', |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = TramitacaoForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
local = MateriaLegislativa.objects.get( |
|
|
@ -688,8 +590,6 @@ class TramitacaoCrud(MasterDetailCrud): |
|
|
|
return super(CreateView, self).post(request, *args, **kwargs) |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = TramitacaoUpdateForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs): |
|
|
|
materia = MateriaLegislativa.objects.get( |
|
|
@ -709,7 +609,6 @@ class TramitacaoCrud(MasterDetailCrud): |
|
|
|
return qs.filter(**kwargs).order_by('-data_tramitacao', '-id') |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def delete(self, request, *args, **kwargs): |
|
|
|
tramitacao = Tramitacao.objects.get(id=self.kwargs['pk']) |
|
|
@ -762,78 +661,56 @@ class DocumentoAcessorioCrud(MasterDetailCrud): |
|
|
|
model = DocumentoAcessorio |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
class BaseMixin(MasterDetailCrud.BaseMixin): |
|
|
|
list_field_names = ['nome', 'tipo', 'data', 'autor', 'arquivo'] |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = DocumentoAcessorioForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
def __init__(self, **kwargs): |
|
|
|
montar_helper_documento_acessorio(self) |
|
|
|
super(CreateView, self).__init__(*args, **kwargs) |
|
|
|
super(MasterDetailCrud.CreateView, self).__init__(**kwargs) |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(CreateView, self).get_context_data(**kwargs) |
|
|
|
context = super( |
|
|
|
MasterDetailCrud.CreateView, self).get_context_data(**kwargs) |
|
|
|
context['helper'] = self.helper |
|
|
|
return context |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = DocumentoAcessorioForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
def __init__(self, **kwargs): |
|
|
|
montar_helper_documento_acessorio(self) |
|
|
|
super(UpdateView, self).__init__(*args, **kwargs) |
|
|
|
super(MasterDetailCrud.UpdateView, self).__init__(**kwargs) |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(UpdateView, self).get_context_data(**kwargs) |
|
|
|
context['helper'] = self.helper |
|
|
|
return context |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
class AutoriaCrud(MasterDetailCrud): |
|
|
|
model = Autoria |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = AutoriaForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = AutoriaForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
|
|
|
|
class DespachoInicialCrud(MasterDetailCrud): |
|
|
|
model = DespachoInicial |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = DespachoInicialForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = DespachoInicialForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
|
|
|
|
class LegislacaoCitadaCrud(MasterDetailCrud): |
|
|
|
model = LegislacaoCitada |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
class BaseMixin(MasterDetailCrud.BaseMixin): |
|
|
|
list_field_names = ['norma', 'disposicoes'] |
|
|
@ -843,13 +720,7 @@ class LegislacaoCitadaCrud(MasterDetailCrud): |
|
|
|
return reverse('%s:%s' % (namespace, self.url_name(suffix)), |
|
|
|
args=args) |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = LegislacaoCitadaForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = LegislacaoCitadaForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
self.initial['tipo'] = self.object.norma.tipo.id |
|
|
@ -857,9 +728,6 @@ class LegislacaoCitadaCrud(MasterDetailCrud): |
|
|
|
self.initial['ano'] = self.object.norma.ano |
|
|
|
return self.initial |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class DetailView(MasterDetailCrud.DetailView): |
|
|
|
|
|
|
|
@property |
|
|
@ -871,69 +739,35 @@ class NumeracaoCrud(MasterDetailCrud): |
|
|
|
model = Numeracao |
|
|
|
parent_field = 'materia' |
|
|
|
help_path = '' |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = NumeracaoForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = NumeracaoForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
|
|
|
|
class AnexadaCrud(MasterDetailCrud): |
|
|
|
model = Anexada |
|
|
|
parent_field = 'materia_principal' |
|
|
|
help_path = '' |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
class BaseMixin(MasterDetailCrud.BaseMixin): |
|
|
|
list_field_names = ['materia_anexada', 'data_anexacao'] |
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
form_class = AnexadaForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
form_class = AnexadaForm |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
self.initial['tipo'] = self.object.materia_anexada.tipo.id |
|
|
|
self.initial['numero'] = self.object.materia_anexada.numero |
|
|
|
self.initial['ano'] = self.object.materia_anexada.ano |
|
|
|
|
|
|
|
return self.initial |
|
|
|
|
|
|
|
class DetailView(MasterDetailCrud.DetailView): |
|
|
|
|
|
|
|
@property |
|
|
|
def layout_key(self): |
|
|
|
return 'AnexadaDetail' |
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
class MateriaLegislativaCrud(Crud): |
|
|
|
model = MateriaLegislativa |
|
|
|
help_path = 'materia_legislativa' |
|
|
|
public = [RP_LIST, RP_DETAIL] |
|
|
|
|
|
|
|
class BaseMixin(CrudBaseMixin): |
|
|
|
class BaseMixin(Crud.BaseMixin): |
|
|
|
list_field_names = ['tipo', 'numero', 'ano', 'data_apresentacao'] |
|
|
|
|
|
|
|
class CreateView(CrudCreateView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class UpdateView(CrudUpdateView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
class DeleteView(CrudDeleteView): |
|
|
|
permission_required = permissoes_materia() |
|
|
|
|
|
|
|
|
|
|
|
# FIXME - qual a finalidade dessa classe?? |
|
|
|
class DocumentoAcessorioView(PermissionRequiredMixin, CreateView): |
|
|
|
template_name = "materia/documento_acessorio.html" |
|
|
|
form_class = DocumentoAcessorioForm |
|
|
|