Dao complex filtering #181

This commit is contained in:
2025-09-27 22:35:48 +02:00
parent d8c60defba
commit a12a4082db
9 changed files with 137 additions and 16 deletions

View File

@@ -7,9 +7,9 @@ from model.post import Post
class PostFilter(Filter[Post]):
def __init__(self):
Filter.__init__(self)
self.field("id", int)
self.field("title", str)
self.field("content", str)
self.int_field("id")
self.string_field("title")
self.string_field("content")
class PostSort(Sort[Post]):
def __init__(self):
@@ -18,7 +18,6 @@ class PostSort(Sort[Post]):
self.field("title", SortOrder)
self.field("content", SortOrder)
class PostGraphType(GraphType[Post]):
def __init__(self):
@@ -35,4 +34,4 @@ class PostGraphType(GraphType[Post]):
self.string_field(
"content",
resolver=lambda root: root.content,
)
)