Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(category): add the sort property on the category model #544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions alexandria/core/migrations/0017_category_sort.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
1 change: 1 addition & 0 deletions alexandria/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Category(SlugModel):
null=True,
related_name="children",
)
sort = models.IntegerField(blank=True, null=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make sense to add sort as the default ordering to meta



class TagSynonymGroup(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions alexandria/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class Meta:
"color",
"parent",
"children",
"sort",
)


Expand Down
Loading
Loading