荷城网站制作公司,表3-5企业网站建设可行性分析,在线制作电子公章免费,网站建设证书首页列表显示全部问答#xff1a;将数据库查询结果传递到前端页面 Question.query.all()前端页面循环显示整个列表。问答排序完成问答详情页布局#xff1a;包含问答的全部信息评论区以往评论列表显示区。在首页点击问答标题#xff0c;链接到相应详情页。app.route(/base2)…首页列表显示全部问答将数据库查询结果传递到前端页面 Question.query.all()前端页面循环显示整个列表。问答排序完成问答详情页布局包含问答的全部信息评论区以往评论列表显示区。在首页点击问答标题链接到相应详情页。 app.route(/base2)
def base2():context{question:Question.query.all()}return render_template(base2.html,**context)app.route(/detail/)
def detail():return render_template(detail.html)
复制代码 {% for foo in question%}div idheader stylebackground-color: antiquewhite;width:400px h2 aligncenter stylemargin-bottom:0;评论大杂烩/h2/divdiv idcontent stylebackground-color: beige;height:150px;width:400px;float: left;div classlistboxul classalistli id001 classlistspan classglyphicon glyphicon-leaf aria-hiddentrue/spana href#NAME:{{ foo.author.username }}/abra href#TITLE:{{ foo.title }}/abra href#COMMENT:{{ foo.detail }}/aspan classbadge stylemargin-left: 60%{{ foo.create_time }}/spanp stylemargin-left: 25%/p/li/ul/div/divdiv idfooter stylebackground-color: bisque;clear: both;text-align: center;width:400px i版权 Doublewhere/i/div/div{% endfor %} % extends base.html %}
{% block title %}DETAIL{% endblock %}
{% block head %}{% endblock %}
{% block main %}div idquestion-feedback stylewidth:400px div idheader stylebackground-color: antiquewhite; h2 aligncenter stylemargin-bottom:0; 详细评论 /h2/divform idcontent stylebackground-color: beige;height:200px;width:400px;float: left;form action{{ url_for(question) }} methodpost div classquestion-controldivlabel forquestion评论标题/labelbr/divdivlabel forquestionDetail问答/labelbrtextarea classform-control rows6 idquestionDetail placeholder请输入详细问答styleheight: 120px;width: 320px namedetail/textarea/divdiv classsubmit-button button typesubmit stylefloat:left idsubmit-button提交/button/divdiv idfooter stylebackground-color: bisque;clear: both;text-align: center;i版权 Doublewhere/i/div/div/form/form/div{% endblock %} 转载于:https://www.cnblogs.com/0058kyle/p/7989015.html