def create_participation_for_project(self, creation_time, project,
                                      student):
     participation = Participation()
     participation.set_creation_time(creation_time)
     participation.set_project(project)
     participation.set_student(student)
     participation.set_id(1)
     with ParticipationMapper() as mapper:
         mapper.find_participation_of_project(project)
    def create_participation(self, module_id, project_id, student_id):
        """Teilnahme erstellen"""

        participation = Participation()
        participation.set_module_id(module_id)
        participation.set_project_id(project_id)
        participation.set_student_id(student_id)
        participation.set_id(1)

        with ParticipationMapper() as mapper:
            return mapper.insert(participation)
    def create_particpation_for_student(self, student):
        """Für einen gegebenen Studenten einen neuen Teilnahme anlegen."""
        with ParticipationMapper() as mapper:
            if student is not None:
                participation = Participation()
                participation.set_student_id(student.get_id())
                participation.set_id(1)

                return mapper.insert(participation)
            else:
                return None
    def create_participation(self, id, creation_time, project, student):
        """Einen Teilnahme anlegen"""

        participation = Participation()
        participation.set_creation_time(creation_time)
        participation.set_project(project)
        participation.set_student(student)
        participation.set_id(id)
        participation.set_id(1)

        with ParticipationMapper() as mapper:
            return mapper.insert(participation)
 def get_participation_by_id(self, id):
     """Teilnahme per ID ausgeben"""
     with ParticipationMapper() as mapper:
         return mapper.find_by_key(id)
 def get_participation_of_project(self, participation):
     """Die Teilnahme des gegebenen Projektes auslesen."""
     with ParticipationMapper() as mapper:
         return mapper.find_by_project(participation.get_id())
 def get_participation_of_student(self, student):
     """Die Teilnahme des gegebenen Studenten auslesen."""
     with ParticipationMapper() as mapper:
         return mapper.find_by_student(student.get_id())
 def save_participation(self, participation):
     """Teilnahme speichern"""
     with ParticipationMapper() as mapper:
         mapper.update(participation)
 def delete_participation(self, participation):
     """Teilnahme aus der DB löschen"""
     with ParticipationMapper() as mapper:
         mapper.delete(participation)
 def get_participation_by_student_id(self, student_id):
     """Teilnahme mit gegebenen Student_ID ausgeben lassen"""
     with ParticipationMapper() as mapper:
         return mapper.find_by_student(student_id)
 def get_participation_by_validation_id(self, validation_id):
     """Teilnahme mit gegebenen Validation_ID ausgeben lassen"""
     with ParticipationMapper() as mapper:
         return mapper.find_by_validation(validation_id)
 def get_participation_by_module_id(self, module_id):
     """Teilnahme mit gegebenen Module_ID ausgeben lassen"""
     with ParticipationMapper() as mapper:
         return mapper.find_by_module(module_id)
 def get_participation_by_project_id(self, project_id):
     """Teilnahme mit gegebenen Project_ID ausgeben lassen"""
     with ParticipationMapper() as mapper:
         return mapper.find_by_project(project_id)
 def get_all_participations(self):
     """Alle Teilnahmen ausgeben"""
     with ParticipationMapper() as mapper:
         return mapper.find_all()
 def get_participation_by_id(self, id):
     """Die Teilnahme mit der gegebenen ID auslesen."""
     with ParticipationMapper() as mapper:
         return mapper.find_by_id(id)
 def get_participation_of_student(self, stu):
     with ParticipationMapper() as mapper:
         return mapper.find_participation_of_student(stu)
 def get_participation_for_project(self, pro):
     with ParticipationMapper() as mapper:
         return mapper.find_participation_of_project(pro)
 def update_participation(self, participation):
     """Die Teilnahme updaten."""
     with ParticipationMapper() as mapper:
         mapper.update(participation)
 def insert_participaion(self, participation):
     """Die Teilnahme einfügen"""
     with ParticipationMapper() as mapper:
         mapper.insert(participation)
 def delete_participation(self, participation):
     """Den gegebenen Teilnahme aus unserem System löschen."""
     with ParticipationMapper() as mapper:
         mapper.delete(participation)