add link_resolver.py

This commit is contained in:
phernandez
2025-01-12 17:44:26 -06:00
parent c5d21276de
commit bdedf53566
7 changed files with 348 additions and 2 deletions
@@ -23,6 +23,11 @@ class EntityRepository(Repository[Entity]):
query = self.select().where(Entity.permalink == permalink).options(*self.get_load_options())
return await self.find_one(query)
async def get_by_title(self, title: str) -> Optional[Entity]:
"""Get entity by title."""
query = self.select().where(Entity.title == title).options(*self.get_load_options())
return await self.find_one(query)
async def list_entities(
self,
entity_type: Optional[str] = None,