From: Michael Tremer Date: Tue, 30 Dec 2025 15:24:07 +0000 (+0000) Subject: reports: Export the list slug in the API X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30bab6d6df3bed16f833df14a5916615d1527555;p=dbl.git reports: Export the list slug in the API Signed-off-by: Michael Tremer --- diff --git a/src/dnsbl/reports.py b/src/dnsbl/reports.py index 5ba4434..565ed19 100644 --- a/src/dnsbl/reports.py +++ b/src/dnsbl/reports.py @@ -19,6 +19,7 @@ ############################################################################### import datetime +import pydantic import sqlmodel import uuid @@ -80,6 +81,11 @@ class Report(sqlmodel.SQLModel, database.BackendMixin, table=True): # List list : "List" = sqlmodel.Relationship(back_populates="reports") + @pydantic.computed_field + @property + def list_slug(self) -> str: + return self.list.slug + # Name name : str