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
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
def getall(self): return g_Entity.select()
def query_all(limit=20): return g_Entity.select().limit(limit)