You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you want to use crud.get_joined on your router read_item method. What you end up doing is something like:
class MyItemRouter(EndpointCreator):
def _read_items(self):
"""Creates an endpoint for reading multiple items from the database."""
async def endpoint(
db: SessionDep,
) -> list[MissionObjectives]:
return await self.crud.get_joined(db, <joined_params...>)
return endpoint
Implementing your own crud methods and calling them in overriden EndpointCreator methods should be common and simple approach, while currently it's quite verbose.