mirror of https://github.com/interlegis/sapl.git
12 changed files with 87 additions and 179 deletions
@ -0,0 +1,20 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.13 on 2018-02-23 16:16 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('base', '0014_auto_20180219_1402'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AddField( |
||||
|
model_name='appconfig', |
||||
|
name='receber_recibo_proposicao', |
||||
|
field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Protocolar proposição somente com recibo?'), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,29 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
def popula_campo_data_inicio(apps, schema_editor): |
||||
|
Mandato = apps.get_model("parlamentares", "Mandato") |
||||
|
mandatos = Mandato.objects.all() |
||||
|
|
||||
|
for m in mandatos: |
||||
|
if m.data_inicio_mandato == None: |
||||
|
m.data_inicio_mandato = m.legislatura.data_inicio |
||||
|
m.save() |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
# A dependencia real desse script é o arquivo 0001_initial.py, mas |
||||
|
# isso gera um erro (Conflicting migrations detected; multiple leaf |
||||
|
# nodes in the migration graph). para não ocasionar problemas de migração, |
||||
|
# vamos manter a ordem padrão do django. |
||||
|
('parlamentares', '0019_auto_20180221_1155'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunPython(popula_campo_data_inicio), |
||||
|
] |
||||
Loading…
Reference in new issue