Beispiel #1
0
 def put(self, id):
     # create a new Marker
     response = jsonify(status_code = 200)
     form = EditMarkerForm.from_json(request.get_json(), csrf_enabled=False)
     if form.validate():
         newMarker = formToMarker(form)
         db.session.add(newMarker)
         db.session.commit()
     else:
         response.data = "Validation error"
         response.status_code = 301
     return response
Beispiel #2
0
 def put(self, id):
     # create a new Marker
     response = jsonify(status_code=200)
     form = EditMarkerForm.from_json(request.get_json(), csrf_enabled=False)
     if form.validate():
         newMarker = formToMarker(form)
         db.session.add(newMarker)
         db.session.commit()
     else:
         response.data = "Validation error"
         response.status_code = 301
     return response
Beispiel #3
0
 def post(self):
     # create a new Marker
     response = jsonify(status_code=201)
     form = EditMarkerForm.from_json(request.get_json(), csrf_enabled=False)
     if form.validate():
         newMarker = formToMarker(form)
         db.session.add(newMarker)
         db.session.commit()
         response.headers['location'] = url_for("MarkersAPI_PUT", id=newMarker.id)
     else:
         response.status_code = 301
     return response
Beispiel #4
0
 def post(self):
     # create a new Marker
     response = jsonify(status_code=201)
     form = EditMarkerForm.from_json(request.get_json(), csrf_enabled=False)
     if form.validate():
         newMarker = formToMarker(form)
         db.session.add(newMarker)
         db.session.commit()
         response.headers['location'] = url_for("MarkersAPI_PUT",
                                                id=newMarker.id)
     else:
         response.status_code = 301
     return response