Example #1
0
def get_accounts(db: Session, skip: int = 0, limit: int = 100):
    res = db.query(models.Account).offset(skip).limit(limit).all()
    return (translators.to_dto(res_line) for res_line in res)
Example #2
0
def get_account_by_title(db: Session, title: str):
    res = db.query(models.Account).filter(models.Account.title == title).first()
    return translators.to_dto(res)
Example #3
0
def get_user_by_name(db: Session, name: str):
    res = db.query(models.User).filter(models.User.name == name).first()
    return translators.to_dto(res)
Example #4
0
def get_account(db: Session, account_id: int):
    res = db.query(models.Account).filter(models.Account.aid == account_id).first()
    return translators.to_dto(res)
Example #5
0
def get_user(db: Session, user_id: int):
    res = db.query(models.User).filter(models.User.uid == user_id).first()
    return translators.to_dto(res)