예제 #1
0
파일: field.py 프로젝트: Tukki/xweb
 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
파일: field.py 프로젝트: Tukki/xweb
 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
파일: structure.py 프로젝트: Tukki/xweb
 def canUseCache(cls, use_cache):
     return UnitOfWork.inst().use_cache and use_cache
예제 #6
0
파일: structure.py 프로젝트: Tukki/xweb
 def getClient(cls, **kwargs):
     cache_name = cls.cacheName(**kwargs)
     return UnitOfWork.inst().cache_manager.get(cache_name)
예제 #7
0
파일: field.py 프로젝트: Tukki/xweb
 def all(self):
     from xweb.orm.unitofwork import UnitOfWork
     return UnitOfWork.inst().getListByCond(self)
예제 #8
0
파일: field.py 프로젝트: Tukki/xweb
 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)