日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

首页列表显示全部问答,完成问答详情页布局

發布時間:2023/12/10 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 首页列表显示全部问答,完成问答详情页布局 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
  • 首頁列表顯示全部問答:
  • 將數據庫查詢結果傳遞到前端頁面 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 id="header" style="background-color: antiquewhite;width:400px "><h2 align="center" style="margin-bottom:0;">評論大雜燴</h2></div><div id="content" style="background-color: beige;height:150px;width:400px;float: left;"><div class="listbox"><ul class="alist"><li id='001' class="list"><span class="glyphicon glyphicon-leaf" aria-hidden="true"></span><a href="#">NAME:{{ foo.author.username }}</a><br><a href="#">TITLE:{{ foo.title }}</a><br><a href="#">COMMENT:{{ foo.detail }}</a><span class="badge" style="margin-left: 60%">{{ foo.create_time }}</span><p style="margin-left: 25%"></p></li></ul></div></div><div id="footer" style="background-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 id="question-feedback" style="width:400px "><div id="header" style="background-color: antiquewhite; "><h2 align="center" style="margin-bottom:0;"> 詳細評論 </h2></div><form id="content" style="background-color: beige;height:200px;width:400px;float: left;"><form action="{{ url_for('question') }}" method="post" ><div class="question-control"><div><label for="question">評論標題:</label><br></div><div><label for="questionDetail">問答:</label><br><textarea class="form-control" rows="6" id="questionDetail" placeholder="請輸入詳細問答"style="height: 120px;width: 320px" name="detail"></textarea></div><div class="submit-button" ><button type="submit" style="float:left" id="submit-button">提交</button></div><div id="footer" style="background-color: bisque;clear: both;text-align: center;"><i>版權 @Doublewhere</i></div></div></form></form></div>{% endblock %}

    ?

    轉載于:https://www.cnblogs.com/0058kyle/p/7989015.html

    總結

    以上是生活随笔為你收集整理的首页列表显示全部问答,完成问答详情页布局的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。