def get_superior(relation): pid = relation.pid if pid == 0: return Relation(ROOT, -1) relations = sqlite_dao.query_by_condition(Relation, id=pid) if relations: return relations[0]
def get_member_by_name(name): """ 根据会员姓名获取会员 :param name: 会员姓名 :return: 会员对象 """ members = sqlite_dao.query_by_condition(Member, name=name) if members: return members[0]