OnetoOnefIEld反向查询:obj.user.all()
ForeignKey反向查询:obj.user_set.all()
{% extends ‘base.HTML‘ %}{% block body %}<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluID"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">{% block pro_name %}Project name{% endblock %}</a> </div> <div ID="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li class="dropdown "> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" >{{ request.user }} <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">个人信息</a></li> <li><a href="{% url ‘logout‘ %}">logout</a></li> </ul> </li> </ul> </div> </div></nav><div class="container-fluID"> <div class="row"> <div class="col-sm-3 col-md-2 sIDebar"> <ul class="nav nav-sIDebar">{# {{ request.user.userprofile.role.all }}#} {% for role in request.user.userprofile.role.select_related %} {% for menu in role.menus.select_related %} <li><a href="{% if menu.url_type == 0 %}{{ menu.url_name }}{% else %}{% url menu.url_name %}{% endif %}">{{ menu.name }}</a></li> {% endfor %} {% endfor %} </ul> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> {% block right-content-container %} <h2 class="page-header">Dashboard</h2> {% endblock %} </div> </div></div>{% endblock %}index.HTML @H_262_502@ 总结
以上是内存溢出为你收集整理的CRM项目实战,动态菜单设计全部内容,希望文章能够帮你解决CRM项目实战,动态菜单设计所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)