parent
cc3059b9ed
commit
37c6d121a3
@ -0,0 +1,26 @@ |
||||
# Generated by Django 4.2.11 on 2024-04-12 15:41 |
||||
|
||||
from django.conf import settings |
||||
from django.db import migrations, models |
||||
import django.db.models.deletion |
||||
import uuid |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('tournaments', '0025_customuser_country'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.CreateModel( |
||||
name='Purchase', |
||||
fields=[ |
||||
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)), |
||||
('identifier', models.IntegerField()), |
||||
('purchaseDate', models.DateTimeField()), |
||||
('productId', models.CharField(max_length=100)), |
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
||||
], |
||||
), |
||||
] |
||||
@ -0,0 +1,18 @@ |
||||
# Generated by Django 4.2.11 on 2024-04-17 08:11 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('tournaments', '0026_purchase'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='tournament', |
||||
name='payment', |
||||
field=models.IntegerField(blank=True, choices=[(0, 'Gratuit'), (1, 'Unité'), (2, 'Unité abonnement'), (3, 'Illimité')], default=0, null=True), |
||||
), |
||||
] |
||||
@ -0,0 +1,23 @@ |
||||
# Generated by Django 4.2.11 on 2024-04-22 07:59 |
||||
|
||||
from django.db import migrations |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('tournaments', '0027_tournament_payment'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RenameField( |
||||
model_name='purchase', |
||||
old_name='productId', |
||||
new_name='product_id', |
||||
), |
||||
migrations.RenameField( |
||||
model_name='purchase', |
||||
old_name='purchaseDate', |
||||
new_name='purchase_date', |
||||
), |
||||
] |
||||
@ -0,0 +1,13 @@ |
||||
from django.db import models |
||||
import uuid |
||||
from . import CustomUser |
||||
|
||||
class Purchase(models.Model): |
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True) |
||||
user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) |
||||
identifier = models.IntegerField() |
||||
purchase_date = models.DateTimeField() |
||||
product_id = models.CharField(max_length=100) |
||||
|
||||
def __str__(self): |
||||
return f"{self.identifier} > {self.product_id} - {self.purchase_date} - {self.user.username}" |
||||
Loading…
Reference in new issue