东方耀AI技术分享

标题: 35、python_django_web开发_课程机构的筛选(城市和类别)与排序_... [打印本页]

作者: 东方耀    时间: 2017-11-26 19:46
标题: 35、python_django_web开发_课程机构的筛选(城市和类别)与排序_...

35、python_django_web开发_课程机构的筛选(城市和类别)与排序_笔记
列表筛选功能   城市的筛选与类别的筛选
课程机构的筛选(城市和类别)与排序
机构的排名  排序功能

  1. <font face="微软雅黑" size="5">{% ifequal city_id city.id|stringformat:'i' %}
  2.       active2
  3. {% endifequal %}

  4. # 对热门机构的提取
  5. hot_orgs = all_orgs.order_by('-click_num')[:5]

  6. {% for hot_org in hot_orgs %}
  7.     <dl class="des">
  8.         <dt class="num fl">{{ forloop.counter }}</dt>
  9.         <dd>
  10.             <a href="/company/2/"><h1>{{ hot_org.name }}</h1></a>
  11.             <p>{{ hot_org.address }}</p>
  12.         </dd>
  13.     </dl>
  14. {% endfor %}</font>
复制代码



作者: xiaoma    时间: 2017-12-14 14:52
1
作者: 渡口    时间: 2018-6-8 22:19
非常感谢
作者: xiaodan    时间: 2018-12-26 15:47
谢谢老师
作者: tchsong    时间: 2019-11-8 12:32
城市的筛选与类别的筛选




欢迎光临 东方耀AI技术分享 (http://www.ai111.vip/) Powered by Discuz! X3.4