def add_talk(name, topics=None): talk = Talk(name=name) if topics is not None: for t in topics: if not type(t) == Topic: _topic = t['topic'] _subs = t['sub_topics'] add_topic(talk, _topic, _subs) else: add_topic(talk, t) return talk.save()
def add_talk(name,topics=None): talk = Talk(name=name) if topics is not None: for t in topics: if not type(t) == Topic: _topic = t['topic'] _subs = t['sub_topics'] add_topic(talk,_topic,_subs) else: add_topic(talk,t) return talk.save()
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())