def stundenzettel(request): dbsession = DBSession() kontakte = dbsession.query(Contact).all() logged_in = authenticated_userid(request) if kontakte is None: return HTTPNotFound("invalid kontakte") else: return {"kontakte": kontakte, "body_id": "stundenzettel", "logged_in": logged_in}
def add_project(request): retval = {"body_id": "add_project"} if "submit" in request.POST: controls = request.POST.items() try: appstruct = Form(forms.project).validate(controls) except ValidationFailure, e: retval.update({"form": e.render()}) return retval appstruct["address_id"] = appstruct.pop("address") DBSession.add(Project(**appstruct)) retval.update({"form": "Success"}) return retval