def post(self): talk = Talk.objects(id=flask.request.form['talk_id']) talk = (len(talk) > 0) and talk[0] topic = Topic(name=flask.request.form['name']).save() talk.topics.append(topic) talk.save() return flask.jsonify(talk=json.loads(talk.to_json()))
def post(self): talk = Talk.objects(id=flask.request.form['talk_id']) talk = (len(talk)>0) and talk[0] topic = Topic(name=flask.request.form['name']).save() talk.topics.append(topic) talk.save() return flask.jsonify(talk=json.loads(talk.to_json()))
def get(self, talk_id): talk = Talk.objects(id=talk_id) talk = (len(talk) > 0) and talk[0] rtn = format_talk(talk.to_json()) return flask.render_template('talks.html', talk=rtn, talk_id=talk_id, is_edit_mode=is_edit())
def get(self,talk_id): talk = Talk.objects(id=talk_id) talk = (len(talk)>0) and talk[0] rtn = format_talk(talk.to_json()) return flask.render_template('talks.html',talk=rtn,talk_id=talk_id,is_edit_mode=is_edit())