def create_person(self, creation_date, name, google_id, role_id): """Eine Person anlegen""" person = Person() person.set_name(name) person.set_google_id(google_id) person.set_role_id(role_id) person.set_id(1) with PersonMapper() as mapper: return mapper.insert(person)
def get_person_by_role_id(self, role_id): """Alle Personen mit einer bestimmten Rolle ausgeben""" with PersonMapper() as mapper: return mapper.find_by_role_id(role_id)
def get_person_by_google_id(self, google_id): """Die Person mit ihrer Google-ID ausgeben""" with PersonMapper() as mapper: return mapper.find_by_google_id(google_id)
def get_person_by_name(self, name): """Die Person mit ihrem Namen auslesen""" with PersonMapper() as mapper: return mapper.find_by_name(name)
def get_all_persons(self): """Alle Personen ausgeben""" with PersonMapper() as mapper: return mapper.find_all()
def get_person_by_id(self, id): """Die Person mit ihrer gegebenen ID auslesen""" with PersonMapper() as mapper: return mapper.find_by_id(id)
def delete_person(self, person): """Person löschen""" with PersonMapper() as mapper: mapper.delete(person)
def save_person(self, person): """Die Person speichern""" with PersonMapper() as mapper: mapper.update(person)