Order labels by name
fixes: https://todo.sr.ht/~sircmpwn/todo.sr.ht/160
This commit is contained in:
parent
8841a12b6e
commit
e7c801b46a
|
@ -12,7 +12,8 @@ class Label(Base):
|
|||
sa.ForeignKey("tracker.id", ondelete="CASCADE"),
|
||||
nullable=False)
|
||||
tracker = sa.orm.relationship("Tracker",
|
||||
backref=sa.orm.backref("labels", cascade="all, delete-orphan"))
|
||||
backref=sa.orm.backref(
|
||||
"labels", cascade="all, delete-orphan", order_by="Label.name"))
|
||||
|
||||
name = sa.Column(sa.Text, nullable=False)
|
||||
color = sa.Column(sa.Text, nullable=False)
|
||||
|
|
|
@ -56,7 +56,9 @@ class Ticket(Base):
|
|||
"""Permissions granted to anonymous (non-logged in) users"""
|
||||
|
||||
view_list = sa.orm.relationship("TicketSeen")
|
||||
labels = sa.orm.relationship("Label", secondary="ticket_label")
|
||||
|
||||
labels = sa.orm.relationship("Label",
|
||||
secondary="ticket_label", order_by="Label.name")
|
||||
|
||||
assigned_users = sa.orm.relationship("User",
|
||||
secondary="ticket_assignee",
|
||||
|
|
Loading…
Reference in New Issue