|
@ -605,6 +605,7 @@ class ExpedienteMateriaCrud(MasterDetailCrud): |
|
|
layout_key = 'ExpedienteMateriaDetail' |
|
|
layout_key = 'ExpedienteMateriaDetail' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Orador das Explicações Pessoais |
|
|
class OradorCrud(MasterDetailCrud): |
|
|
class OradorCrud(MasterDetailCrud): |
|
|
model = Orador |
|
|
model = Orador |
|
|
parent_field = 'sessao_plenaria' |
|
|
parent_field = 'sessao_plenaria' |
|
@ -623,32 +624,6 @@ class OradorCrud(MasterDetailCrud): |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
return {'id_sessao': self.kwargs['pk']} |
|
|
|
|
|
|
|
|
|
|
|
def get_success_url(self): |
|
|
|
|
|
return reverse('sapl.sessao:orador_list', |
|
|
|
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
|
|
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
initial = super().get_initial() |
|
|
|
|
|
initial.update({'id_sessao': self.object.sessao_plenaria.id}) |
|
|
|
|
|
initial.update({'numero': self.object.numero_ordem}) |
|
|
|
|
|
|
|
|
|
|
|
return initial |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OradorExpedienteCrud(OradorCrud): |
|
|
|
|
|
model = OradorExpediente |
|
|
|
|
|
|
|
|
|
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
class CreateView(MasterDetailCrud.CreateView): |
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
form_class = OradorForm |
|
@ -670,16 +645,7 @@ class OradorExpedienteCrud(OradorCrud): |
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
kwargs={'pk': self.kwargs['pk']}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
class DetailView(MasterDetailCrud.DetailView): |
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
initial = super().get_initial() |
|
|
|
|
|
initial.update({'id_sessao': self.object.sessao_plenaria.id}) |
|
|
|
|
|
initial.update({'numero':self.object.numero_ordem}) |
|
|
|
|
|
|
|
|
|
|
|
return initial |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super().get_context_data(**kwargs) |
|
|
context = super().get_context_data(**kwargs) |
|
@ -691,7 +657,15 @@ class OradorExpedienteCrud(OradorCrud): |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DetailView(MasterDetailCrud.DetailView): |
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
|
|
|
|
|
|
form_class = OradorForm |
|
|
|
|
|
|
|
|
|
|
|
def get_initial(self): |
|
|
|
|
|
initial = super().get_initial() |
|
|
|
|
|
initial.update({'id_sessao': self.object.sessao_plenaria.id}) |
|
|
|
|
|
initial.update({'numero': self.object.numero_ordem}) |
|
|
|
|
|
return initial |
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super().get_context_data(**kwargs) |
|
|
context = super().get_context_data(**kwargs) |
|
@ -747,6 +721,15 @@ class OradorExpedienteCrud(OradorCrud): |
|
|
return {'id_sessao': self.object.sessao_plenaria.id, |
|
|
return {'id_sessao': self.object.sessao_plenaria.id, |
|
|
'numero': self.object.numero_ordem} |
|
|
'numero': self.object.numero_ordem} |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
pk = context['root_pk'] |
|
|
|
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
class ListView(MasterDetailCrud.ListView): |
|
|
|
|
|
|
|
@ -770,13 +753,12 @@ class OradorExpedienteCrud(OradorCrud): |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
class DeleteView(MasterDetailCrud.DeleteView): |
|
|
class UpdateView(MasterDetailCrud.UpdateView): |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super().get_context_data(**kwargs) |
|
|
context = super().get_context_data(**kwargs) |
|
|
pk = context['root_pk'] |
|
|
sessao_pk = context['root_pk'] |
|
|
sessao = SessaoPlenaria.objects.get(id=pk) |
|
|
sessao = SessaoPlenaria.objects.get(id=sessao_pk) |
|
|
tipo_sessao = sessao.tipo |
|
|
tipo_sessao = sessao.tipo |
|
|
if tipo_sessao.nome == "Solene": |
|
|
if tipo_sessao.nome == "Solene": |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
@ -953,6 +935,14 @@ class SessaoCrud(Crud): |
|
|
namespace = self.model._meta.app_config.name |
|
|
namespace = self.model._meta.app_config.name |
|
|
return reverse('%s:%s' % (namespace, 'sessaoplenaria_list')) |
|
|
return reverse('%s:%s' % (namespace, 'sessaoplenaria_list')) |
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
|
sessao = context['object'] |
|
|
|
|
|
tipo_sessao = sessao.tipo |
|
|
|
|
|
if tipo_sessao.nome == "Solene": |
|
|
|
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
|
|
|
return context |
|
|
|
|
|
|
|
|
class DetailView(Crud.DetailView): |
|
|
class DetailView(Crud.DetailView): |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
@ -970,7 +960,6 @@ class SessaoCrud(Crud): |
|
|
tipo_sessao = sessao.tipo |
|
|
tipo_sessao = sessao.tipo |
|
|
if tipo_sessao.nome == "Solene": |
|
|
if tipo_sessao.nome == "Solene": |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
context.update({'subnav_template_name': 'sessao/subnav-solene.yaml'}) |
|
|
# self.layout_key = 'SessaoSolene' |
|
|
|
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|