|
|
@ -14,7 +14,7 @@ class TitleCollectionModel(BaseModel):
|
|
|
|
page_id: Mapped[int] = mapped_column(sqlalchemy.Integer, index=True, nullable=True)
|
|
|
|
page_id: Mapped[int] = mapped_column(sqlalchemy.Integer, index=True, nullable=True)
|
|
|
|
|
|
|
|
|
|
|
|
class TitleCollectionHelper(BaseHelper):
|
|
|
|
class TitleCollectionHelper(BaseHelper):
|
|
|
|
async def add(self, title: str, page_id: Optional[int] = None) -> Union[int, bool]:
|
|
|
|
async def add(self, title: str, page_id: Optional[int] = None) -> TitleCollectionModel | None:
|
|
|
|
stmt = select(TitleCollectionModel.id).where(TitleCollectionModel.title == title)
|
|
|
|
stmt = select(TitleCollectionModel.id).where(TitleCollectionModel.title == title)
|
|
|
|
result = await self.session.scalar(stmt)
|
|
|
|
result = await self.session.scalar(stmt)
|
|
|
|
|
|
|
|
|
|
|
|