diff --git a/alexandria/core/migrations/0017_category_sort.py b/alexandria/core/migrations/0017_category_sort.py new file mode 100644 index 00000000..b3a167d0 --- /dev/null +++ b/alexandria/core/migrations/0017_category_sort.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.25 on 2024-05-06 13:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("alexandria_core", "0016_category_allowed_mime_types"), + ] + + operations = [ + migrations.AddField( + model_name="category", + name="sort", + field=models.IntegerField(blank=True, null=True), + ), + ] diff --git a/alexandria/core/models.py b/alexandria/core/models.py index a867083c..a7261e27 100644 --- a/alexandria/core/models.py +++ b/alexandria/core/models.py @@ -117,6 +117,7 @@ class Category(SlugModel): null=True, related_name="children", ) + sort = models.IntegerField(blank=True, null=True) class TagSynonymGroup(BaseModel): diff --git a/alexandria/core/serializers.py b/alexandria/core/serializers.py index 7abccc7a..03d7168b 100644 --- a/alexandria/core/serializers.py +++ b/alexandria/core/serializers.py @@ -118,6 +118,7 @@ class Meta: "color", "parent", "children", + "sort", )