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

        return None
Exemple #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
Exemple #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
Exemple #5
0
 def canUseCache(cls, use_cache):
     return UnitOfWork.inst().use_cache and use_cache
Exemple #6
0
 def getClient(cls, **kwargs):
     cache_name = cls.cacheName(**kwargs)
     return UnitOfWork.inst().cache_manager.get(cache_name)
Exemple #7
0
 def all(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().getListByCond(self)
Exemple #8
0
 def row(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().fetchRowByCond(self)
Exemple #9
0
 def canUseCache(cls, use_cache):
     return UnitOfWork.inst().use_cache and use_cache
Exemple #10
0
 def getClient(cls, **kwargs):
     cache_name = cls.cacheName(**kwargs)
     return UnitOfWork.inst().cache_manager.get(cache_name)
Exemple #11
0
 def all(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().getListByCond(self)
Exemple #12
0
 def row(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().fetchRowByCond(self)