[WIP] Library REST API
This commit is contained in:
@@ -5,4 +5,8 @@ from ....schema.library.base import Base
|
||||
|
||||
def read(session:Session, _id:int, obj:Base):
|
||||
stmt = select(obj).where(obj.id == _id)
|
||||
return session.scalars(stmt).one()
|
||||
return session.scalars(stmt).one()
|
||||
|
||||
def read_all(session:Session, obj:Base):
|
||||
stmt = select(obj)
|
||||
return session.scalars(stmt).fetchall() #TODO: Pagination
|
||||
Reference in New Issue
Block a user