Пример #1
0
 def one(self):
     from xweb.orm.unitofwork import UnitOfWork
     result = UnitOfWork.inst().fetchRowByCond(self)
     if result:
         return result[0]
     
     return None
Пример #2
0
    def one(self):
        from xweb.orm.unitofwork import UnitOfWork
        result = UnitOfWork.inst().fetchRowByCond(self)
        if result:
            return result[0]

        return None
Пример #3
0
 def first(self):
     from xweb.orm.unitofwork import UnitOfWork
     self.limit(1)
     result = UnitOfWork.inst().getListByCond(self)
     if result:
         return result[0]
     
     return None
Пример #4
0
    def first(self):
        from xweb.orm.unitofwork import UnitOfWork
        self.limit(1)
        result = UnitOfWork.inst().getListByCond(self)
        if result:
            return result[0]

        return None
Пример #5
0
 def canUseCache(cls, use_cache):
     return UnitOfWork.inst().use_cache and use_cache
Пример #6
0
 def getClient(cls, **kwargs):
     cache_name = cls.cacheName(**kwargs)
     return UnitOfWork.inst().cache_manager.get(cache_name)
Пример #7
0
 def all(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().getListByCond(self)
Пример #8
0
 def row(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().fetchRowByCond(self)
Пример #9
0
 def canUseCache(cls, use_cache):
     return UnitOfWork.inst().use_cache and use_cache
Пример #10
0
 def getClient(cls, **kwargs):
     cache_name = cls.cacheName(**kwargs)
     return UnitOfWork.inst().cache_manager.get(cache_name)
Пример #11
0
 def all(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().getListByCond(self)
Пример #12
0
 def row(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().fetchRowByCond(self)