Example #1
0
def user_detail(id):
    u = User.one(id=id)
    if u is None:
        abort(404)
    else:
        t = Topic.all_tapic_of_user(u.id)
        r = Topic.all_tapic_of_user_in(u.id)
        return render_template('profile.html', user=u, topic=t, topic_in=r)
Example #2
0
def profile():
    u = current_user()
    t = Topic.all_tapic_of_user(u.id)
    r = Topic.all_tapic_of_user_in(u.id)
    log('这个用户所有的话题 :{}\n'.format(t), '这个用户参与的话题 :{}'.format(r))
    if u is None:
        return redirect(url_for('.index'))
    else:
        return render_template('profile.html', user=u, topic=t, topic_in=r)