Browse Source

Remove campo não usado em protocolar matéria

pull/788/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
35dfe2fafa
  1. 19
      sapl/norma/migrations/0019_auto_20161028_0232.py
  2. 39
      sapl/norma/migrations/0020_auto_20161028_1335.py
  3. 24
      sapl/norma/migrations/0021_auto_20161028_1335.py
  4. 23
      sapl/protocoloadm/forms.py
  5. 20
      sapl/protocoloadm/migrations/0006_auto_20161103_1721.py
  6. 2
      sapl/protocoloadm/models.py
  7. 1
      sapl/protocoloadm/views.py

19
sapl/norma/migrations/0019_auto_20161028_0232.py

@ -1,19 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-28 02:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('norma', '0018_auto_20161027_1434'),
]
operations = [
migrations.AlterUniqueTogether(
name='assuntonormarelationship',
unique_together=set([('assunto', 'norma')]),
),
]

39
sapl/norma/migrations/0020_auto_20161028_1335.py

@ -1,39 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-28 13:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('norma', '0019_auto_20161028_0232'),
]
operations = [
migrations.AlterUniqueTogether(
name='assuntonormarelationship',
unique_together=set([]),
),
migrations.RemoveField(
model_name='assuntonormarelationship',
name='assunto',
),
migrations.RemoveField(
model_name='assuntonormarelationship',
name='norma',
),
migrations.RemoveField(
model_name='normajuridica',
name='assuntos',
),
migrations.AddField(
model_name='normajuridica',
name='assuntos',
field=models.TextField(blank=True, null=True),
),
migrations.DeleteModel(
name='AssuntoNormaRelationship',
),
]

24
sapl/norma/migrations/0021_auto_20161028_1335.py

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-28 13:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('norma', '0020_auto_20161028_1335'),
]
operations = [
migrations.RemoveField(
model_name='normajuridica',
name='assuntos',
),
migrations.AddField(
model_name='normajuridica',
name='assuntos',
field=models.ManyToManyField(blank=True, to='norma.AssuntoNorma', verbose_name='Assuntos'),
),
]

23
sapl/protocoloadm/forms.py

@ -21,6 +21,7 @@ from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
TramitacaoAdministrativo)
TIPOS_PROTOCOLO = [('0', 'Enviado'), ('1', 'Recebido'), ('', 'Ambos')]
TIPOS_PROTOCOLO_CREATE = [('0', 'Enviado'), ('1', 'Recebido')]
NATUREZA_PROCESSO = [('', 'Ambos'),
('0', 'Administrativo'),
@ -270,7 +271,7 @@ class ProtocoloDocumentForm(ModelForm):
tipo_protocolo = forms.ChoiceField(required=True,
label=_('Tipo de Protocolo'),
choices=TIPOS_PROTOCOLO,)
choices=TIPOS_PROTOCOLO_CREATE,)
tipo_documento = forms.ModelChoiceField(
label=_('Tipo de Documento'),
@ -330,11 +331,6 @@ class ProtocoloDocumentForm(ModelForm):
class ProtocoloMateriaForm(ModelForm):
tipo_protocolo = forms.ChoiceField(required=True,
label='Tipo de Protocolo',
choices=TIPOS_PROTOCOLO,)
autor = forms.IntegerField(widget=forms.HiddenInput(), required=False)
def clean_autor(self):
@ -349,8 +345,7 @@ class ProtocoloMateriaForm(ModelForm):
class Meta:
model = Protocolo
fields = ['tipo_protocolo',
'tipo_materia',
fields = ['tipo_materia',
'numero_paginas',
'autor',
'observacao']
@ -358,11 +353,9 @@ class ProtocoloMateriaForm(ModelForm):
def __init__(self, *args, **kwargs):
row1 = to_row(
[(InlineRadios('tipo_protocolo'), 12)])
row2 = to_row(
[('tipo_materia', 4),
('numero_paginas', 4)])
row3 = to_row(
row2 = to_row(
[('autor', 0),
(Button('pesquisar',
'Pesquisar Autor',
@ -370,25 +363,23 @@ class ProtocoloMateriaForm(ModelForm):
(Button('limpar',
'limpar Autor',
css_class='btn btn-primary btn-sm'), 10)])
row4 = to_row(
row3 = to_row(
[('observacao', 12)])
self.helper = FormHelper()
self.helper.layout = Layout(
Fieldset(_('Identificação da Matéria'),
row1,
HTML(autor_label),
HTML(autor_modal),
row2,
HTML(autor_label),
HTML(autor_modal),
row3,
row4,
form_actions(save_label='Protocolar Matéria')
)
)
super(ProtocoloMateriaForm, self).__init__(
*args, **kwargs)
self.fields['tipo_protocolo'].inline_class = True
class DocumentoAcessorioAdministrativoForm(ModelForm):

20
sapl/protocoloadm/migrations/0006_auto_20161103_1721.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-03 17:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('protocoloadm', '0005_auto_20161027_1741'),
]
operations = [
migrations.AlterField(
model_name='protocolo',
name='tipo_protocolo',
field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Tipo de Protocolo'),
),
]

2
sapl/protocoloadm/models.py

@ -119,7 +119,7 @@ class Protocolo(models.Model):
# TODO transformar campo timestamp em auto_now_add
timestamp = models.DateTimeField()
tipo_protocolo = models.PositiveIntegerField(
verbose_name=_('Tipo de Protocolo'))
blank=True, null=True, verbose_name=_('Tipo de Protocolo'))
tipo_processo = models.PositiveIntegerField()
interessado = models.CharField(
max_length=60, blank=True, verbose_name=_('Interessado'))

1
sapl/protocoloadm/views.py

@ -361,7 +361,6 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView):
protocolo.data = datetime.now().strftime("%Y-%m-%d")
protocolo.hora = datetime.now().strftime("%H:%M")
protocolo.timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
protocolo.tipo_protocolo = self.request.POST['tipo_protocolo']
protocolo.tipo_processo = '0' # TODO validar o significado
if form.cleaned_data['autor']:
protocolo.autor = form.cleaned_data['autor']

Loading…
Cancel
Save