def create_member(self, data): self.check_data(data) try: with self._database_engine.new_session() as session: # Save member in database member = MemberDAO(session).create(data) member_data = member.to_dict() return member_data except Error as e: return None
def create_member(self, data: dict): self._check_profile_data(data) try: with self._database_engine.new_session() as session: # Save sport in database member = MemberDAO(session).create(data) member_data = member.to_dict() return member_data except Error as e: # log error raise e
def create_member(self, data): self._check_profile_data(data) try: with self._database_engine.new_session() as session: # Save member in database member = MemberDAO(session).create(data) member_data = member.to_dict() return member_data except Error as e: # log error print("An Error occured (%s)" % str(e)) raise e
def get_member(self, member_id): with self._database_engine.new_session() as session: member = MemberDAO(session).get(member_id) member_data = member.to_dict() return member_data
def get_member_by_name(self, firstname: str, lastname: str): with self._database_engine.new_session() as session: member = MemberDAO(session).get_by_name(firstname, lastname) member_data = member.to_dict() return member_data