8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00
re2o/cotisations/migrations/0043_separation_membership_connection_p1.py
histausse b317eceec3 Split the membership duration from the connection duration
changes:

Article:
remove COTISATION_TYPE, duration(_days), type_cotisation
add duration(_days)_connection, duration(_days)_membership

Vente:
remove COTISATION_TYPE, duration(_days), type_cotisation
add duration(_days)_connection, duration(_days)_membership
add method `test_membership_or_connection()` to replace
`bool(type_cotisation)`

Cotisation:
remove COTISATION_TYPE, date_start, date_end, type_cotisation
add date_start_con, date_end_con, date_start_memb, date_end_memb

create_cotis(date_start=False) -> create_cotis(date_start_con=False, date_start_memb=False)

+ migration
+ changes to use the new models in the remaining of the code
2021-01-24 16:36:16 +01:00

117 lines
4.8 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-20 17:19
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cotisations', '0042_auto_20191120_0159'),
]
operations = [
# migrations.RemoveField(
# model_name='article',
# name='duration',
# ),
# migrations.RemoveField(
# model_name='article',
# name='duration_days',
# ),
# migrations.RemoveField(
# model_name='article',
# name='type_cotisation',
# ),
# migrations.RemoveField(
# model_name='cotisation',
# name='date_end',
# ),
# migrations.RemoveField(
# model_name='cotisation',
# name='date_start',
# ),
# migrations.RemoveField(
# model_name='cotisation',
# name='type_cotisation',
# ),
# migrations.RemoveField(
# model_name='vente',
# name='duration',
# ),
# migrations.RemoveField(
# model_name='vente',
# name='duration_days',
# ),
# migrations.RemoveField(
# model_name='vente',
# name='type_cotisation',
# ),
migrations.AddField(
model_name='article',
name='duration_connection',
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the connection (in months)'),
),
migrations.AddField(
model_name='article',
name='duration_days_connection',
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the connection (in days, will be added to duration in months)'),
),
migrations.AddField(
model_name='article',
name='duration_days_membership',
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the membership (in days, will be added to duration in months)'),
),
migrations.AddField(
model_name='article',
name='duration_membership',
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the membership (in months)'),
),
migrations.AddField(
model_name='cotisation',
name='date_end_con',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='end date for the connection'),
preserve_default=False,
),
migrations.AddField(
model_name='cotisation',
name='date_end_memb',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='end date for the membership'),
preserve_default=False,
),
migrations.AddField(
model_name='cotisation',
name='date_start_con',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='start date for the connection'),
preserve_default=False,
),
migrations.AddField(
model_name='cotisation',
name='date_start_memb',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='start date for the membership'),
preserve_default=False,
),
migrations.AddField(
model_name='vente',
name='duration_connection',
field=models.PositiveIntegerField(blank=True, null=True, verbose_name='duration of the connection (in months)'),
),
migrations.AddField(
model_name='vente',
name='duration_days_connection',
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the connection (in days, will be added to duration in months)'),
),
migrations.AddField(
model_name='vente',
name='duration_days_membership',
field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='duration of the membership (in days, will be added to duration in months)'),
),
migrations.AddField(
model_name='vente',
name='duration_membership',
field=models.PositiveIntegerField(blank=True, null=True, verbose_name='duration of the membership (in months)'),
),
]