Browse Source

Add status field to Proposicao

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
087bde79f2
  1. 19
      materia/migrations/0006_proposicao_status.py
  2. 19
      materia/migrations/0007_auto_20151021_1200.py
  3. 10
      materia/models.py

19
materia/migrations/0006_proposicao_status.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('materia', '0005_auto_20150923_0941'),
]
operations = [
migrations.AddField(
model_name='proposicao',
name='status',
field=models.CharField(verbose_name='Status Proposição', max_length=1, blank=True, choices=[('P', 'Pendente'), ('D', 'Devolvida'), ('I', 'Incorporada')], null=True),
),
]

19
materia/migrations/0007_auto_20151021_1200.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('materia', '0006_proposicao_status'),
]
operations = [
migrations.AlterField(
model_name='proposicao',
name='status',
field=models.CharField(max_length=1, verbose_name='Status Proposição', blank=True, null=True, choices=[('E', 'Enviada'), ('D', 'Devolvida'), ('I', 'Incorporada')]),
),
]

10
materia/models.py

@ -447,6 +447,16 @@ class Proposicao(models.Model):
numero_proposicao = models.PositiveIntegerField(
blank=True, null=True, verbose_name=_('Número'))
# ind_enviado and ind_devolvido collapsed as char field (status)
status = models.CharField(blank=True,
null=True,
max_length = 1,
choices=(('E', 'Enviada'),
('D', 'Devolvida'),
('I', 'Incorporada')),
verbose_name=_('Status Proposição'))
# mutually exclusive (depend on tipo.materia_ou_documento)
materia = models.ForeignKey(
MateriaLegislativa, blank=True, null=True, verbose_name=_('Matéria'))

Loading…
Cancel
Save