标签:结果 text css 点击 发送 sub button ace rac
@app.route(‘/‘) def index(): context={ ‘questions‘: Question.query.order_by(‘-creat_time‘).all() } return render_template(‘base.html‘,**context)
{% block main %} <p>{{user}}context</p> <ul class="list-group"> {%for foo in questions %} <li class="list-group-item" > <a class="author" href="#">{{ foo.author.username }}</a><br> <a class="title" href="{{url_for(‘detail‘,question_id=foo.id)}}">{{foo.title}}</a><br> <span>{{foo.creat_time}}</span> <p class="abstract">{{foo.detail}}</p> </li> {% endfor %} </ul> {% endblock %}
{% extends "base.html" %} {% block title%}问答详情{% endblock %} {% block head %} <!-- 引入 Bootstrap --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> {% endblock %} {% block main %} <div class="page-header"> <h3>Title{{ques}}<br><small>author r</small></h3> </div> <p class="lead">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="write your comment"></textarea> </div> <button type="submit"class="btn btn-default">发送</button> </form> <ul class="list-group"style="margin:10px"> {% endblock %} </ul>
标签:结果 text css 点击 发送 sub button ace rac
原文地址:http://www.cnblogs.com/BerylF/p/7954719.html