feat: add Products form to admin
This commit is contained in:
26
purchase/migrations/0002_purchasableproduct.py
Normal file
26
purchase/migrations/0002_purchasableproduct.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 6.0.4 on 2026-05-18 14:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('purchase', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='PurchasableProduct',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('price_cents', models.PositiveIntegerField(help_text='Price in cents')),
|
||||
('currency', models.CharField(default='usd', max_length=10)),
|
||||
('stripe_product_id', models.CharField(blank=True, max_length=255, null=True)),
|
||||
('stripe_price_id', models.CharField(blank=True, max_length=255, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0.4 on 2026-05-18 14:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('purchase', '0002_purchasableproduct'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='purchasableproduct',
|
||||
name='currency',
|
||||
field=models.CharField(default='pln', max_length=10),
|
||||
),
|
||||
]
|
||||
21
purchase/migrations/0004_purchasableproduct_course.py
Normal file
21
purchase/migrations/0004_purchasableproduct_course.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 6.0.4 on 2026-05-18 15:05
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('home', '0023_eventindexpage'),
|
||||
('purchase', '0003_alter_purchasableproduct_currency'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='purchasableproduct',
|
||||
name='course',
|
||||
field=models.OneToOneField(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='purchasable_product', to='home.coursepage'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user