博客
关于我
强烈建议你试试无所不能的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

你可能感兴趣的文章
在主引导记录(MBR)的救援模式下如何重新安装GRUB引导装载程序
查看>>
我的友情链接
查看>>
git的基本使用和示例
查看>>
用户管理
查看>>
从输入 URL 到页面加载完的过程中都发生了什么事情?
查看>>
揭秘Windows Server2012 核心虚拟化技术Hyper-V
查看>>
去除文本中重复的行方法
查看>>
On Stack Replacement and JIT
查看>>
linux 搜索并替换文件内容
查看>>
我的友情链接
查看>>
dns详解
查看>>
设备驱动
查看>>
How To Use Repadmin for Active Directory Troubleshooting
查看>>
韩顺平.linux视频教程第7讲.j2ee环境.jdk.t
查看>>
邮箱数据库增长统计
查看>>
awk学习笔记之一BEGIN和END
查看>>
一套书读懂LTE!
查看>>
函数与模块间作用域的区别
查看>>
SQL Server扩展事件(Extended Events)-- 使用system_health默认跟踪会话监控死锁
查看>>
oc面向对象特性: 多态
查看>>