def delete_update(update_id): u = Update(redis=g.r, user=g.user) u.load(update_id) if u.user.key != g.user.key: abort(401) u.delete() flash("Update deleted.", 'success') return redirect(url_for('frontend.timeline'))
def conversation(conversation_id): updates = [] for key in g.r.lrange('conversation:%s' % conversation_id, 0, -1): u = Update(redis=g.r, user=g.user) u.load(key) updates.append(u) return render_template('timeline.html', timeline=updates, title='Conversation #%s' % conversation_id, disable_input=True, disable_userbox=True)
def post_update(): try: g.user.username except AttributeError: abort(401) u = Update(text=request.form['text'], user=g.user, redis=g.r, respond=request.form['respond']) try: u.save() flash("Update posted.", 'success') except UpdateError: pass return redirect(url_for('frontend.timeline'))
def event_add_reply(update_id, event_id): u = Update(redis=g.r, user=g.user) u.load(update_id) return render_template('respond.html', update=u, event=event_id)
def respond_update(update_id): u = Update(redis=g.r, user=g.user) u.load(update_id) return render_template('respond.html', update=u)