Beispiel #1
0
    def post(self):
        """Anlegen eines neuen Personen-Objekts"""
        adm = ProjectAdministration()
        proposal = Person.from_dict(api.payload)

        if proposal is not None:
            pers = adm.create_person(proposal.get_creation_date(), proposal.get_name(), proposal.get_google_id(), proposal.get_role_id())
            return pers, 200
        else:
            return '', 500
Beispiel #2
0
    def put(self):
        """Update eines bestimmten Personen-Objekts."""
        adm = ProjectAdministration()
        pers = Person.from_dict(api.payload)
        print(pers)

        if pers is not None:
            adm.save_person(pers)
            return pers, 200
        else:
            return '', 500