关于Djiango中 前端多对多字段点(,)的显示问题

 去除点的方法:

                <td>
                    {% for roles_son in roles.permissions.all %}
                        {% if forloop.last %} # 利用模板语言中的循环机制来判断
                            {{ roles_son }} &nbsp;
                        {% else %}
                        {{ roles_son }} &nbsp; , &nbsp;
                        {% endif %}
                    {% endfor %}
                </td>

猜你喜欢

转载自www.cnblogs.com/Rivend/p/11711274.html
今日推荐