def one(self): from xweb.orm.unitofwork import UnitOfWork result = UnitOfWork.inst().fetchRowByCond(self) if result: return result[0] return None
def first(self): from xweb.orm.unitofwork import UnitOfWork self.limit(1) result = UnitOfWork.inst().getListByCond(self) if result: return result[0] return None
def canUseCache(cls, use_cache): return UnitOfWork.inst().use_cache and use_cache
def getClient(cls, **kwargs): cache_name = cls.cacheName(**kwargs) return UnitOfWork.inst().cache_manager.get(cache_name)
def all(self): from xweb.orm.unitofwork import UnitOfWork return UnitOfWork.inst().getListByCond(self)
def row(self): from xweb.orm.unitofwork import UnitOfWork return UnitOfWork.inst().fetchRowByCond(self)