63 lines
2.2 KiB
Python
63 lines
2.2 KiB
Python
import uuid
|
|
|
|
import django.db.models.deletion
|
|
import django_extensions.db.fields
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("core", "0007_alter_category_image"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="DigitalAssetDownload",
|
|
fields=[
|
|
(
|
|
"uuid",
|
|
models.UUIDField(
|
|
default=uuid.uuid4,
|
|
editable=False,
|
|
help_text="unique id is used to surely identify any database object",
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="unique id",
|
|
),
|
|
),
|
|
(
|
|
"is_active",
|
|
models.BooleanField(
|
|
default=True,
|
|
help_text="if set to false, this object can't be seen by users without needed permission",
|
|
verbose_name="is active",
|
|
),
|
|
),
|
|
(
|
|
"created",
|
|
django_extensions.db.fields.CreationDateTimeField(
|
|
auto_now_add=True,
|
|
help_text="when the object first appeared on the database",
|
|
verbose_name="created",
|
|
),
|
|
),
|
|
(
|
|
"modified",
|
|
django_extensions.db.fields.ModificationDateTimeField(
|
|
auto_now=True, help_text="when the object was last modified", verbose_name="modified"
|
|
),
|
|
),
|
|
("num_downloads", models.IntegerField(default=0)),
|
|
(
|
|
"order_product",
|
|
models.OneToOneField(
|
|
on_delete=django.db.models.deletion.CASCADE, related_name="download", to="core.orderproduct"
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "download",
|
|
"verbose_name_plural": "downloads",
|
|
},
|
|
),
|
|
]
|