From: Michael Tremer Date: Wed, 14 Jan 2026 18:29:34 +0000 (+0000) Subject: lists: Allow to limit the domain history X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb8e2bdeac9eb0afb830346f45399a66b5af86fa;p=dbl.git lists: Allow to limit the domain history Signed-off-by: Michael Tremer --- diff --git a/src/dbl/lists.py b/src/dbl/lists.py index 23b8f33..315e002 100644 --- a/src/dbl/lists.py +++ b/src/dbl/lists.py @@ -767,7 +767,7 @@ class List(sqlmodel.SQLModel, database.BackendMixin, table=True): return self.backend.db.select(stmt) - def get_domain_history(self, name): + def get_domain_history(self, name, limit=None): """ Fetches the history the given domain """ @@ -783,6 +783,7 @@ class List(sqlmodel.SQLModel, database.BackendMixin, table=True): .order_by( domains.DomainEvent.timestamp.desc(), ) + .limit(limit) ) return self.backend.db.fetch(stmt)