92 wiersze
3.8 KiB
Python
92 wiersze
3.8 KiB
Python
# Generated by Django 4.1.9 on 2023-05-10 19:40
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import modelcluster.fields
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Product',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('price', models.FloatField()),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ProductAuthor',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='ProductCategory',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ProductCategoryParam',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('key', models.CharField(max_length=200)),
|
|
('param_type', models.CharField(choices=[('int', 'Int'), ('str', 'String'), ('float', 'Float')], max_length=200)),
|
|
('category', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='category_params', to='store.productcategory')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='TemplateParamValue',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('value', models.CharField(max_length=255)),
|
|
('param', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.productcategoryparam')),
|
|
('product', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='param_values', to='store.product')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='ProductTemplate',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=255)),
|
|
('code', models.CharField(max_length=255)),
|
|
('description', models.TextField()),
|
|
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.productauthor')),
|
|
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.productcategory')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ProductImage',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('image', models.ImageField(upload_to='')),
|
|
('template', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='store.producttemplate')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='product',
|
|
name='template',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.producttemplate'),
|
|
),
|
|
]
|