博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
完成个人中心 导航标签
阅读量:6907 次
发布时间:2019-06-27

本文共 2038 字,大约阅读时间需要 6 分钟。

      1. 个人中心—视图函数带标签页面参数tag
        @app.route('/usercenter/<user_id>/<tag>')
        def usercenter(user_id, tag):
           if tag == ‘1':
               return render_template('usercenter1.html', **context)
      2. 个人中心—导航标签链接增加tag参数
        <li role=“presentation”><a href=“{
        { url_for(‘usercenter’,user_id = user.id,tag = ‘1’) }}">全部问答</a></li>
      3. 个人中心—有链接到个人中心页面的url增加tag参数
        u <a href="{
        { url_for('usercenter',user_id = session.get('userid'), tag=1) }}">{
        { session.get('user') }}</a>
    1. {% extends 'base.html' %} {% block title %}     个人中心 {% endblock %} {% block link %} {% endblock %} {% block box %}     
      {% block subComment %}{% endblock %}
      {% endblock %} {% block script %} {% endblock %}
    2. {% extends 'comment.html' %} {% block subComment %}     
      {% endblock %}

      名称: {
      { user2.username }}

      问题数: {
      { questions|length }}

      评论数: {
      { comment|length }}

转载于:https://www.cnblogs.com/-064/p/8041498.html

你可能感兴趣的文章
cisco 2811路由器详细配置
查看>>
烂泥:vcenter5.5无AD下的安装与配置
查看>>
iOS开发那些事--创建基于故事板的iOS 6的HelloWorld
查看>>
理解并取:frame-relay的工作原理
查看>>
MariaDB 10.3支持update多表ORDER BY and LIMIT
查看>>
2015年值得关注的几个WEB技术
查看>>
Goroutine(协程)为何能处理大并发?
查看>>
QTP中VBS脚本下FSO、WSH的应用——实例讲解
查看>>
乐视超级手机的跨界影响
查看>>
A dream and two wheels
查看>>
我花50元赚来190元的贴吧推广经验
查看>>
指针和引用
查看>>
Python应用01 原始Python服务器
查看>>
Android应用程序与SurfaceFlinger服务的关系概述和学习计划
查看>>
WCF WinCE 中 手机端 非字符串型 datetime,int,decimal,double 等等 传递不到WCF端的解决方案...
查看>>
iis6.0 之前版本发布silverlight程序 注意事项
查看>>
SQL SERVER 2008中启用相应的功能
查看>>
Implementing a small Cron service in C# - CodeProject
查看>>
poj-2155(二维树状数组)
查看>>
NPOI操作 EXCEL文件
查看>>