Browse Source

Fix #909

pull/968/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
bde2bfa969
  1. 4
      sapl/materia/forms.py
  2. 21
      sapl/materia/migrations/0077_auto_20170321_1130.py
  3. 2
      sapl/materia/models.py
  4. 8
      sapl/materia/views.py
  5. 21
      sapl/protocoloadm/migrations/0014_auto_20170321_1130.py

4
sapl/materia/forms.py

@ -190,10 +190,6 @@ class RelatoriaForm(ModelForm):
def __init__(self, *args, **kwargs):
super(RelatoriaForm, self).__init__(*args, **kwargs)
self.fields['parlamentar'].queryset = Parlamentar.objects.filter(
ativo=True, id__in=Participacao.objects.filter(
composicao_id=self.initial['comissao']
).values_list('parlamentar_id')).order_by('nome_completo')
def clean(self):
cleaned_data = self.cleaned_data

21
sapl/materia/migrations/0077_auto_20170321_1130.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-03-21 11:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('materia', '0076_merge'),
]
operations = [
migrations.AlterField(
model_name='relatoria',
name='comissao',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='comissoes.Comissao', verbose_name='Comissão'),
),
]

2
sapl/materia/models.py

@ -489,7 +489,7 @@ class Relatoria(models.Model):
null=True,
verbose_name=_('Motivo Fim Relatoria'))
comissao = models.ForeignKey(
Comissao, blank=True, null=True, verbose_name=_('Localização Atual'))
Comissao, blank=True, null=True, verbose_name=_('Comissão'))
data_designacao_relator = models.DateField(
verbose_name=_('Data Designação'))
data_destituicao_relator = models.DateField(

8
sapl/materia/views.py

@ -47,8 +47,8 @@ from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm,
AdicionarVariasAutoriasFilterSet, DespachoInicialForm,
DocumentoAcessorioForm, MateriaLegislativaFilterSet,
MateriaSimplificadaForm, PrimeiraTramitacaoEmLoteFilterSet,
ReceberProposicaoForm, TramitacaoEmLoteFilterSet,
filtra_tramitacao_destino,
ReceberProposicaoForm, RelatoriaForm,
TramitacaoEmLoteFilterSet, filtra_tramitacao_destino,
filtra_tramitacao_destino_and_status,
filtra_tramitacao_status)
from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial,
@ -808,6 +808,7 @@ class RelatoriaCrud(MasterDetailCrud):
public = [RP_LIST, RP_DETAIL]
class CreateView(MasterDetailCrud.CreateView):
form_class = RelatoriaForm
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@ -848,6 +849,9 @@ class RelatoriaCrud(MasterDetailCrud):
return {'comissao': localizacao}
class UpdateView(MasterDetailCrud.UpdateView):
form_class = RelatoriaForm
class TramitacaoCrud(MasterDetailCrud):
model = Tramitacao

21
sapl/protocoloadm/migrations/0014_auto_20170321_1130.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-03-21 11:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('protocoloadm', '0013_auto_20170320_1637'),
]
operations = [
migrations.AlterField(
model_name='documentoadministrativo',
name='protocolo',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.Protocolo', verbose_name='Protocolo'),
),
]
Loading…
Cancel
Save