mirror of https://github.com/interlegis/sapl.git
3 changed files with 41 additions and 1 deletions
@ -0,0 +1,27 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2017-07-07 16:56 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
import datetime |
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('parlamentares', '0002_auto_20170504_1751'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AddField( |
||||
|
model_name='mandato', |
||||
|
name='data_inicio_mandato', |
||||
|
field=models.DateField(default=datetime.datetime(2017, 7, 7, 16, 56, 58, 525896), verbose_name='Início do Mandato'), |
||||
|
preserve_default=False, |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='mandato', |
||||
|
name='data_fim_mandato', |
||||
|
field=models.DateField(blank=True, null=True, verbose_name='Fim do Mandato'), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,10 @@ |
|||||
|
from sapl.parlamentares.models import Mandato |
||||
|
|
||||
|
|
||||
|
def popula_campo_data_inicio(): |
||||
|
for m in Mandato.objects.all(): |
||||
|
m.data_inicio_mandato = m.legislatura.data_inicio |
||||
|
m.save() |
||||
|
|
||||
|
if __name__ == '__main__': |
||||
|
popula_campo_data_inicio() |
||||
Loading…
Reference in new issue