Make recurring period a database model
- For easier handling (foreignkeys, many2many) - For higher flexibility (users can define their own periods)
This commit is contained in:
parent
58883765d7
commit
992c7c551e
11 changed files with 588 additions and 362 deletions
41
uncloud_pay/migrations/0027_auto_20201006_1319.py
Normal file
41
uncloud_pay/migrations/0027_auto_20201006_1319.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Generated by Django 3.1 on 2020-10-06 13:19
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('uncloud_pay', '0026_order_should_be_billed'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='RecurringPeriod',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('duration_seconds', models.IntegerField(unique=True)),
|
||||
],
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='SampleOneTimeProduct',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='SampleRecurringProduct',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='SampleRecurringProductOneTimeFee',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='order',
|
||||
name='recurring_period',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.recurringperiod'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='product',
|
||||
name='default_recurring_period',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.recurringperiod'),
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue