gault-millau/apps/main/migrations/0051_auto_20200204_1409.py
2020-02-04 17:19:09 +03:00

23 lines
511 B
Python

# Generated by Django 2.2.7 on 2020-02-04 14:09
import datetime
from django.db import migrations
def fill_award_type_ears(apps, schemaeditor):
AwardType = apps.get_model('main', 'AwardType')
for aw in AwardType.objects.all():
aw.years = list(range(1980, datetime.date.today().year+1))
aw.save()
class Migration(migrations.Migration):
dependencies = [
('main', '0050_awardtype_years'),
]
operations = [
migrations.RunPython(fill_award_type_ears),
]