1271201c7dec659a0e5d4460f2111ddcd856332b
[wolnelektury.git] / src / wolnelektury / migrations / getpaid / 0001_initial.py
1 from django.db import models, migrations
2 import django.db.models.deletion
3 import getpaid.abstract_mixin
4
5
6 class Migration(migrations.Migration):
7
8     dependencies = [
9         ('funding', '0001_initial'),
10     ]
11
12     operations = [
13         migrations.CreateModel(
14             name='Payment',
15             fields=[
16                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
17                 ('amount', models.DecimalField(verbose_name='amount', max_digits=20, decimal_places=4)),
18                 ('currency', models.CharField(max_length=3, verbose_name='currency')),
19                 ('status', models.CharField(default='new', max_length=20, verbose_name='status', db_index=True, choices=[('new', 'new'), ('in_progress', 'in progress'), ('partially_paid', 'partially paid'), ('paid', 'paid'), ('failed', 'failed')])),
20                 ('backend', models.CharField(max_length=50, verbose_name='backend')),
21                 ('created_on', models.DateTimeField(auto_now_add=True, verbose_name='created on', db_index=True)),
22                 ('paid_on', models.DateTimeField(default=None, null=True, verbose_name='paid on', db_index=True, blank=True)),
23                 ('amount_paid', models.DecimalField(default=0, verbose_name='amount paid', max_digits=20, decimal_places=4)),
24                 ('external_id', models.CharField(max_length=64, null=True, verbose_name='external id', blank=True)),
25                 ('description', models.CharField(max_length=128, null=True, verbose_name='Description', blank=True)),
26                 ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment', to='funding.Funding')),
27             ],
28             options={
29                 'ordering': ('-created_on',),
30                 'verbose_name': 'Payment',
31                 'verbose_name_plural': 'Payments',
32             },
33             bases=(models.Model, getpaid.abstract_mixin.AbstractMixin),
34         ),
35     ]