Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
    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
Exemple #4
0
 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
Exemple #5
0
 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