Skip to content

Commit

Permalink
Add ordering to LabeledItem model (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
rabstejnek authored Dec 12, 2024
1 parent ba6615c commit f202181
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hawc/apps/assessment/migrations/0047_alter_labeleditem_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.1 on 2024-12-09 00:13

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("assessment", "0046_assessmentvalue_value_type_qualifier"),
]

operations = [
migrations.AlterModelOptions(
name="labeleditem",
options={"ordering": ("content_type", "object_id", "label__path")},
),
]
1 change: 1 addition & 0 deletions hawc/apps/assessment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,7 @@ class Meta:
fields=["label", "content_type", "object_id"], name="label_item"
)
]
ordering = ("content_type", "object_id", "label__path")

def __str__(self):
return f"{self.label} on {self.content_object}"
Expand Down

0 comments on commit f202181

Please sign in to comment.