Recursive complex filtering #181

This commit is contained in:
2025-09-28 01:09:46 +02:00
parent a12a4082db
commit 20e5da5770
16 changed files with 249 additions and 48 deletions

View File

@@ -1,11 +1,15 @@
from cpl.database.abc import DbModelDaoABC
from model.author_dao import AuthorDao
from model.post import Post
class PostDao(DbModelDaoABC):
def __init__(self):
def __init__(self, authors: AuthorDao):
DbModelDaoABC.__init__(self, Post, "posts")
self.attribute(Post.author_id, int, db_name="authorId")
self.reference("author", "id", Post.author_id, "authors", authors)
self.attribute(Post.title, str)
self.attribute(Post.content, str)