def create_student(self, creation_time, name, matriculation_nr, course_abbr): """Einen Studenten anlegen""" student = Student() student.set_creation_time(creation_time) student.set_name(name) student.set_matriculation_nr(matriculation_nr) student.set_course_abbr(course_abbr) student.set_id(1) with StudentMapper() as mapper: return mapper.insert(student)
def create_student(self, user_id, name, course, matriculation_number, mail, google_id): """Erstellen des Studenten""" student = Student() student.set_user_id(user_id) student.set_name(name) student.set_course(course) student.set_matriculation_number(matriculation_number) student.set_mail(mail) student.set_google_id(google_id) student.set_id(1) with StudentMapper() as mapper: return mapper.insert(student)
def get_student_by_google_id(self, google_id): """Studenten per Google_id ausgeben""" with StudentMapper() as mapper: return mapper.find_by_google_id(google_id)
def get_student_by_matriculation_number(self, matriculation_number): """Studenten per Matrikelnummer ausgeben""" with StudentMapper() as mapper: return mapper.find_by_matriculation_number(matriculation_number)
def get_student_by_name(self, name): """Studenten per Name ausgeben""" with StudentMapper() as mapper: return mapper.find_by_name(name)
def get_student_by_course(self, course): """Studenten per Kurs ausgeben""" with StudentMapper() as mapper: return mapper.find_by_course(course)
def get_student_by_id(self, id): """Studenten per ID ausgeben""" with StudentMapper() as mapper: return mapper.find_by_key(id)
def get_student_by_user_id(self, user_id): """Studenten per User_id ausgeben""" with StudentMapper() as mapper: return mapper.find_by_user_id(user_id)
def get_student_by_mail(self, email): """Alle Studenten mit Namen name auslesen.""" with StudentMapper() as mapper: return mapper.find_by_mail(email)
def get_student_by_course_abbr(self, course_abbr): """Den Studenten mit der gegebenen course_abbr auslesen.""" with StudentMapper() as mapper: return mapper.find_student_by_course_abbr(course_abbr)
def get_student_by_id(self, id): """Den Studenten mit der gegebenen ID auslesen.""" with StudentMapper() as mapper: return mapper.find_by_id(id)
def get_student_by_email(self, email): with StudentMapper() as mapper: return mapper.find_by_mail(email)
def delete_student(self, student): """Den gegebenen Studenten aus unserem System löschen.""" with StudentMapper() as mapper: mapper.delete(student)
def save_student(self, student): """Den gegebenen Studenten speichern.""" with StudentMapper() as mapper: mapper.update(student)
def get_all_student(self): """Alle Studenten auslesen.""" with StudentMapper() as mapper: return mapper.find_all()
def save_student(self, student): """Studenten speichern""" with StudentMapper() as mapper: mapper.update(student)
def get_all_student(self): """ALle Studenten ausgeben""" with StudentMapper() as mapper: return mapper.find_all()
def delete_student(self, student): """Studenten aus der DB löschen""" with StudentMapper() as mapper: mapper.delete(student)
def get_student_by_matriculation_nr(self, matriculation_nr): """Den Studenten mit der gegebenen matriculaton_nr auslesen.""" with StudentMapper() as mapper: return mapper.find_student_by_matriculation_nr(matriculation_nr)