diff --git a/materia/migrations/0006_proposicao_status.py b/materia/migrations/0006_proposicao_status.py new file mode 100644 index 000000000..d6f84f45a --- /dev/null +++ b/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), + ), + ] diff --git a/materia/migrations/0007_auto_20151021_1200.py b/materia/migrations/0007_auto_20151021_1200.py new file mode 100644 index 000000000..fb3563751 --- /dev/null +++ b/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')]), + ), + ] diff --git a/materia/models.py b/materia/models.py index 3f8eadbf7..0f7da6114 100644 --- a/materia/models.py +++ b/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'))