From: Michael Tremer Date: Sat, 6 Dec 2025 19:29:33 +0000 (+0000) Subject: lists: Fetch sources ordered by their name X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c65777f37b75bf46c16c11d1b78280e3caa3bbb;p=dbl.git lists: Fetch sources ordered by their name Signed-off-by: Michael Tremer --- diff --git a/src/dnsbl/lists.py b/src/dnsbl/lists.py index 679cdaa..887053d 100644 --- a/src/dnsbl/lists.py +++ b/src/dnsbl/lists.py @@ -133,7 +133,16 @@ class List(sqlmodel.SQLModel, database.BackendMixin, table=True): license : str # Sources - sources : typing.List["Source"] = sqlmodel.Relationship(back_populates="list") + sources : typing.List["Source"] = sqlmodel.Relationship( + back_populates="list", + sa_relationship_kwargs={ + "primaryjoin" : """and_( + Source.list_id == List.id, + Source.deleted_at == None, + )""", + "order_by" : "Source.name", + }, + ) # Updated At updated_at : datetime.datetime | None