8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-08 19:06:25 +00:00
re2o/cotisations/migrations/0048_auto_20201017_0018.py
2020-10-17 00:34:56 +02:00

50 lines
2.1 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-10-16 22:18
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cotisations', '0047_article_need_membership_init'),
]
def set_value_to_0(apps, schema_editor):
ventes = apps.get_model("cotisations", "Vente")
ventes.filter(duration_connection__isnull=True).update(duration_connection=0)
ventes.filter(duration_days_connection__isnull=True).update(duration_days_connection=0)
ventes.filter(duration_membership__isnull=True).update(duration_membership=0)
ventes.filter(duration_days_membership__isnull=True).update(duration_days_membership=0)
operations = [
migrations.RunPython(set_value_to_0),
migrations.AlterField(
model_name='article',
name='need_membership',
field=models.BooleanField(default=True, verbose_name='need membership to be purchased'),
),
migrations.AlterField(
model_name='vente',
name='duration_connection',
field=models.PositiveIntegerField(default=0, verbose_name='duration of the connection (in months)'),
),
migrations.AlterField(
model_name='vente',
name='duration_days_connection',
field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the connection (in days, will be added to duration in months)'),
),
migrations.AlterField(
model_name='vente',
name='duration_days_membership',
field=models.PositiveIntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the membership (in days, will be added to duration in months)'),
),
migrations.AlterField(
model_name='vente',
name='duration_membership',
field=models.PositiveIntegerField(default=0, verbose_name='duration of the membership (in months)'),
),
]