3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-05 01:16:28 +00:00
coope/gestion/migrations/0014_auto_20190912_0951.py

34 lines
1 KiB
Python
Raw Normal View History

2019-09-20 20:01:51 +00:00
# Generated by Django 2.1 on 2019-09-12 07:51
import django.core.validators
from django.db import migrations, models
def update(apps, schema_editor):
Keg = apps.get_model('gestion', 'Keg')
for keg in Keg.objects.all():
keg.deg = keg.pinte.deg
keg.save()
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('gestion', '0013_auto_20190829_1219'),
]
operations = [
migrations.AddField(
model_name='historicalkeg',
name='deg',
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Degré'),
),
migrations.AddField(
model_name='keg',
name='deg',
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Degré'),
),
migrations.RunPython(update, reverse)
]