Exemplo n.º 1
0
Arquivo: field.py Projeto: Tukki/xweb
 def one(self):
     from xweb.orm.unitofwork import UnitOfWork
     result = UnitOfWork.inst().fetchRowByCond(self)
     if result:
         return result[0]
     
     return None
Exemplo n.º 2
0
    def one(self):
        from xweb.orm.unitofwork import UnitOfWork
        result = UnitOfWork.inst().fetchRowByCond(self)
        if result:
            return result[0]

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