from app.db.cruddb.crudbase import crudbase from app.db import models, schemas from sqlalchemy.orm import Session class dbtenant(crudbase): def __init__(self): super().__init__(model=models.Tenant) def get_tenant(sefl,db:Session,tenantid: str): tenant = db.execute(super().get_by_conditions({"tenantid":tenantid})).scalars().first() return tenant tenantService = dbtenant()