Skip to content

Commit

Permalink
feat(tables): add order_by attributes
Browse files Browse the repository at this point in the history
Set `order_by` Meta attribute to most relevant
column for each table (resp. group of tables which
inherit from mixin in case of `TitleFieldsMixin`).
  • Loading branch information
koeaw committed Dec 16, 2024
1 parent 78a8118 commit 854ce97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apis_ontology/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class TitleFieldsMixin(tables.Table):

class Meta:
fields = ["title", "subtitle"]
order_by = "title"


class WorkTable(TitleFieldsMixin, BaseEntityTable):
Expand Down Expand Up @@ -102,6 +103,7 @@ class PlaceTable(BaseEntityTable):
class Meta(BaseEntityTable.Meta):
model = Place
fields = ["label"]
order_by = "label"


class GroupTable(BaseEntityTable):
Expand All @@ -110,6 +112,7 @@ class GroupTable(BaseEntityTable):
class Meta(BaseEntityTable.Meta):
model = Group
fields = ["label"]
order_by = "label"


class EventTable(BaseEntityTable):
Expand All @@ -118,6 +121,7 @@ class EventTable(BaseEntityTable):
class Meta(BaseEntityTable.Meta):
model = Event
fields = ["label"]
order_by = "label"


class PerformanceTable(BaseEntityTable):
Expand All @@ -126,6 +130,7 @@ class PerformanceTable(BaseEntityTable):
class Meta(BaseEntityTable.Meta):
model = Performance
fields = ["label"]
order_by = "label"


class PosterTable(BaseEntityTable):
Expand All @@ -134,3 +139,4 @@ class PosterTable(BaseEntityTable):
class Meta(BaseEntityTable.Meta):
model = Poster
fields = ["label"]
order_by = "label"

0 comments on commit 854ce97

Please sign in to comment.