Ejemplo n.º 1
0
 def post(self):
     event = Event()
     # event.key = ndb.Key('Event',int(request.form['id']))
     event.client_id = ndb.Key('Client', int(request.form['client_id']))
     event.name = request.form['name']
     event.description = request.form['description']
     event.duration = int(request.form['duration'])
     res = event.put()
     return jsonify({'id': res.id(), 'message': "Success"})
Ejemplo n.º 2
0
 def post(self):
     event = Event()
     # event.key = ndb.Key('Event',int(request.form['id']))
     print '###################'
     print request.is_json
     print request.json
     user_id = request.environ['USER_ID']
     event.client_id = user_id.get().detail_id
     event.name = request.json['name']
     event.description = request.json['description']
     event.duration = int(request.json['duration'])
     res = event.put()
     return jsonify({'id': res.id(), 'message': "Success"})