-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
2,152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,288 @@ | ||
# Generated by Django 5.0.8 on 2024-08-22 09:06 | ||
|
||
import functools | ||
|
||
import django.db.models.deletion | ||
import django.utils.timezone | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
import dash.utils | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
replaces = [ | ||
("categories", "0001_initial"), | ||
("categories", "0002_auto_20140820_1415"), | ||
("categories", "0003_categoryimage"), | ||
("categories", "0004_auto_20140904_0927"), | ||
("categories", "0005_auto_20140922_1514"), | ||
("categories", "0006_auto_20141008_1955"), | ||
("categories", "0007_auto_20170301_0914"), | ||
("categories", "0008_alter_category_options"), | ||
("categories", "0009_auto_20210910_1450"), | ||
("categories", "0010_alter_category_created_by_alter_category_modified_by_and_more"), | ||
("categories", "0011_alter_category_unique_together_and_more"), | ||
] | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
("orgs", "0005_orgbackground"), | ||
("orgs", "0033_rename_orgs_orgbac_org_id_607508_idx_orgs_orgbac_org_slug_idx_and_more"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Category", | ||
fields=[ | ||
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
( | ||
"is_active", | ||
models.BooleanField( | ||
default=True, help_text="Whether this item is active, use this instead of deleting" | ||
), | ||
), | ||
( | ||
"created_on", | ||
models.DateTimeField(auto_now_add=True, help_text="When this item was originally created"), | ||
), | ||
("modified_on", models.DateTimeField(auto_now=True, help_text="When this item was last modified")), | ||
("name", models.CharField(help_text="The name of this category", max_length=64)), | ||
( | ||
"image", | ||
models.ImageField( | ||
blank=True, | ||
help_text="An optional image that can describe this category", | ||
null=True, | ||
upload_to="categories", | ||
), | ||
), | ||
( | ||
"created_by", | ||
models.ForeignKey( | ||
help_text="The user which originally created this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"modified_by", | ||
models.ForeignKey( | ||
help_text="The user which last modified this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"org", | ||
models.ForeignKey( | ||
help_text="The organization this category applies to", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="orgs.org", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name_plural": "Categories", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="CategoryImage", | ||
fields=[ | ||
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
( | ||
"is_active", | ||
models.BooleanField( | ||
default=True, help_text="Whether this item is active, use this instead of deleting" | ||
), | ||
), | ||
( | ||
"created_on", | ||
models.DateTimeField(auto_now_add=True, help_text="When this item was originally created"), | ||
), | ||
("modified_on", models.DateTimeField(auto_now=True, help_text="When this item was last modified")), | ||
("name", models.CharField(help_text="The name to describe this image", max_length=64)), | ||
("image", models.ImageField(help_text="The image file to use", upload_to="categories")), | ||
( | ||
"category", | ||
models.ForeignKey( | ||
help_text="The category this image represents", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="categories.category", | ||
), | ||
), | ||
( | ||
"created_by", | ||
models.ForeignKey( | ||
help_text="The user which originally created this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
( | ||
"modified_by", | ||
models.ForeignKey( | ||
help_text="The user which last modified this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="created_by", | ||
field=models.ForeignKey( | ||
help_text="The user which originally created this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="categories_category_creations", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="modified_by", | ||
field=models.ForeignKey( | ||
help_text="The user which last modified this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="categories_category_modifications", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="categoryimage", | ||
name="category", | ||
field=models.ForeignKey( | ||
help_text="The category this image represents", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="images", | ||
to="categories.category", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="org", | ||
field=models.ForeignKey( | ||
help_text="The organization this category applies to", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="categories", | ||
to="orgs.org", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="created_on", | ||
field=models.DateTimeField( | ||
blank=True, | ||
default=django.utils.timezone.now, | ||
editable=False, | ||
help_text="When this item was originally created", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="modified_on", | ||
field=models.DateTimeField( | ||
blank=True, | ||
default=django.utils.timezone.now, | ||
editable=False, | ||
help_text="When this item was last modified", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="categoryimage", | ||
name="created_on", | ||
field=models.DateTimeField( | ||
blank=True, | ||
default=django.utils.timezone.now, | ||
editable=False, | ||
help_text="When this item was originally created", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="categoryimage", | ||
name="modified_on", | ||
field=models.DateTimeField( | ||
blank=True, | ||
default=django.utils.timezone.now, | ||
editable=False, | ||
help_text="When this item was last modified", | ||
), | ||
), | ||
migrations.AlterModelOptions( | ||
name="category", | ||
options={"ordering": ["name"], "verbose_name_plural": "Categories"}, | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="image", | ||
field=models.ImageField( | ||
blank=True, | ||
help_text="An optional image that can describe this category", | ||
null=True, | ||
upload_to=functools.partial(dash.utils.generate_file_path, *("categories",), **{}), | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="categoryimage", | ||
name="image", | ||
field=models.ImageField( | ||
help_text="The image file to use", | ||
upload_to=functools.partial(dash.utils.generate_file_path, *("categories",), **{}), | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="created_by", | ||
field=models.ForeignKey( | ||
help_text="The user which originally created this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="%(app_label)s_%(class)s_creations", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="modified_by", | ||
field=models.ForeignKey( | ||
help_text="The user which last modified this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="%(app_label)s_%(class)s_modifications", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="categoryimage", | ||
name="created_by", | ||
field=models.ForeignKey( | ||
help_text="The user which originally created this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="%(app_label)s_%(class)s_creations", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="categoryimage", | ||
name="modified_by", | ||
field=models.ForeignKey( | ||
help_text="The user which last modified this item", | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="%(app_label)s_%(class)s_modifications", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="category", | ||
unique_together=set(), | ||
), | ||
migrations.AddConstraint( | ||
model_name="category", | ||
constraint=models.UniqueConstraint(fields=("name", "org"), name="categories_category_name_unique"), | ||
), | ||
] |
Oops, something went wrong.