From f9bf7a7eaeb9a50c595c1df37d9f07ce108d560f Mon Sep 17 00:00:00 2001 From: Jann Stute Date: Thu, 28 Nov 2024 19:00:53 +0100 Subject: [PATCH] fix: use default value notation instead of if None statement in __post_init__ --- tagstudio/src/core/library/alchemy/enums.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tagstudio/src/core/library/alchemy/enums.py b/tagstudio/src/core/library/alchemy/enums.py index 163b1c57..c0fbf4b5 100644 --- a/tagstudio/src/core/library/alchemy/enums.py +++ b/tagstudio/src/core/library/alchemy/enums.py @@ -75,8 +75,8 @@ class FilterState: """Represent a state of the Library grid view.""" # these should remain - page_index: int | None = None - page_size: int | None = None + page_index: int | None = 0 + page_size: int | None = 500 search_mode: SearchMode = SearchMode.AND # TODO this can be removed? # these should be erased on update @@ -101,11 +101,6 @@ class FilterState: else: self.name = self.name and self.name.strip() - if self.page_index is None: # TODO QTLANG can this just be a default value? - self.page_index = 0 - if self.page_size is None: # TODO QTLANG can this just be a default value? - self.page_size = 500 - @property def summary(self): """Show query summary."""