def getClubFull(id: str, options: dict = {}) -> ClubOptional: """ get club with all fields """ try: idn = int(id) except ValueError: raise RdBadRequest(description='IdNotIntegerValue') row = DbClub.find_single({club_n2o['id']['name']: idn}) n = map_o2n(row, club_o2n) mp = encode_club(n) return mp
def getMemberFull(id: str, options: dict = {}) -> MemberOptional: """ get member with all fields """ try: idn = int(id) except ValueError: raise RdBadRequest(description='IdNotIntegerValue') row = DbMember.find_single({'Matricule': idn}) n = map_o2n(row, member_o2n) mp = encode_member(n) return mp
def getMemberAnon(id: str, options: dict = {}) -> MemberOptional: """ get member basic fields """ try: idn = int(id) except ValueError: raise RdBadRequest(description='IdNotIntegerValue') fieldlist = [member_n2o[f]['name'] for f in MemberAnon.__fields__.keys()] row = DbMember.find_single({'Matricule': idn, '_fieldlist': fieldlist}) n = map_o2n(row, member_o2n) mp = encode_member(n, MemberAnon) return mp
def getClubBasic(id: str, options: dict = {}) -> ClubOptional: """ get member basic fields """ try: idn = int(id) except ValueError: raise RdBadRequest(description='IdNotIntegerValue') fieldlist = [club_n2o[f]['name'] for f in ClubBasic.__fields__.keys()] row = DbClub.find_single({ club_n2o['id']['name']: idn, '_fieldlist': fieldlist }) n = map_o2n(row, club_o2n) mp = encode_club(n, ClubBasic) return mp