Example #1
0
 def get_id_by_impath(self, path):
     uu = g_Entity.select().where(g_Entity.path == path)
     if uu.count() == 1:
         return uu.get().uid
     elif uu.count() > 1:
         return False
     else:
         return False
Example #2
0
    def get_id_by_impath(path):
        logger.info('Get Entiry, Path: {0}'.format(path))

        uu = g_Entity.select().where(g_Entity.path == path)
        if uu.count() == 1:
            return uu.get().uid
        elif uu.count() > 1:
            for rec in uu:
                MEntity.delete(rec.uid)
            return False
        else:
            return False
Example #3
0
 def getall(self):
     return g_Entity.select()
Example #4
0
 def query_all(limit=20):
     return g_Entity.select().limit(limit)