def create_module(self, name: str, edv_number: str): """Ein Modul anlegen""" module = Module() module.set_name(name) module.set_edv_number(edv_number) module.set_id(1) with ModuleMapper() as mapper: return mapper.insert(module)
def remove_project_from_module(self, project, module): """Ein Projekt von einem Modul entfernen""" with ModuleMapper() as mapper: mapper.remove_project_from_module(project, module)
def add_project_to_module(self, project, module): """Ein Projekt einem Modul hinzufügen""" with ModuleMapper() as mapper: mapper.add_project_to_module(project, module)
def get_module_by_edv_number(self, edv_number): """Ein Modul anhand seiner EDV-Nummer ausgeben""" with ModuleMapper() as mapper: return mapper.find_by_number(edv_number)
def get_module_by_name(self, name): """Ein Modul anhand seines Namen auslesen""" with ModuleMapper() as mapper: return mapper.find_by_name(name)
def get_all_modules(self): """Alle Module ausgeben""" with ModuleMapper() as mapper: return mapper.find_all()
def get_module_by_id(self, id): """Ein Modul anhand seiner ID auslesen""" with ModuleMapper() as mapper: return mapper.find_by_id(id)
def delete_module(self, module): """Ein Modul löschen""" with ModuleMapper() as mapper: mapper.delete(module)
def save_module(self, module): """Ein Modul speichern""" with ModuleMapper() as mapper: mapper.update(module)