标签:问答 ext row com block pos htm group default
@app.route(‘/‘)
def index():
context = {
# ‘user‘: ‘YUAN‘,
‘questions‘: Question.query.order_by(‘-creat_time‘).all()
}
return render_template(‘1101.html‘,**context)
{% extends ‘1101.html‘ %} {% block title %}问答详情{% endblock %} {% block main %} <div class="page-header"> <h2>Title{{ ques }}<br> <small>author {{ ques.author_id }}{{ ques.create_time }}</small> </h2> </div> <p class="lead">detail{{ ques.detail }}</p> <hr> <form action="{{ url_for(‘question‘) }}" method="post"> <div class="form-group"> <textarea name="new_comment" class="form-control" rows="3" id="new_comment" placeholder="请写下您的评论"></textarea> </div> <button type="submit" class="btn btn-default">发送</button> </form> <ul class="list-group" style="margin: 10px"></ul> {% endblock %}
<ul class="list-group"> {% for foo in questions %} <li class="list-group-item"> <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span> <a href="#">{{ foo.author.username }}</a> <br> <a href="{{ url_for(‘detail‘,question_id=foo.id) }}">{{ foo.title }}</a> <span class="badge">{{ foo.creat_time }}</span> <p>{{ foo.detail }}</p> </li> {% endfor %} </ul>
标签:问答 ext row com block pos htm group default
原文地址:http://www.cnblogs.com/Qzlhxxx/p/7985965.html