@bp.route('/<int:uid>', methods=['GET', 'POST'])
def view(uid):
    if request.method == 'POST':
        # record hits
        topic = Topic.query.get_or_404(uid)
        topic.hits += 1
        topic.save()
        return jsonify(hits=topic.hits)

    page = force_int(request.args.get('page', 1), 0)
    if not page:
        return abort(404)

    topic = Topic.query.get_or_404(uid)
    node = Node.query.get_or_404(topic.node_id)
    author = Account.query.get_or_404(topic.account_id)
    topic.author = author
    topic.node = node

    if g.user:
        topic.like = LikeTopic.query.filter_by(
            account_id=g.user.id, topic_id=uid
        ).first()

    paginator = Reply.query.filter_by(topic_id=uid).paginate(page)
    paginator.items = fill_with_users(paginator.items)

    form = None
    if g.user:
        form = ReplyForm()

    return render_template(
        'topic/view.html', topic=topic,
        form=form, paginator=paginator
    )
View a topic with the given id.
dataset/ETHPy150Open pythoncn/june/june/handlers/topic.py/view