mirror of https://github.com/interlegis/sapl.git
Edward
8 years ago
committed by
GitHub
8 changed files with 51 additions and 13 deletions
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2016-09-21 15:03 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('parlamentares', '0027_merge'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AddField( |
||||
|
model_name='legislatura', |
||||
|
name='numero', |
||||
|
field=models.PositiveIntegerField(default=1, verbose_name='Número'), |
||||
|
preserve_default=False, |
||||
|
), |
||||
|
] |
@ -0,0 +1,11 @@ |
|||||
|
from sapl.parlamentares.models import Legislatura |
||||
|
|
||||
|
|
||||
|
def popula_numero_legislatura_id(): |
||||
|
for l in Legislatura.objects.all(): |
||||
|
l.numero = l.id |
||||
|
l.save() |
||||
|
|
||||
|
|
||||
|
if __name__ == '__main__': |
||||
|
popula_numero_legislatura_id() |
Loading…
Reference in new issue