Задать вопрос

Тел: +7 965 3737 888

397

Просмотров

2

Ответов

User groups template tag with "else" block support (Allow checking several groups)

<p>An "if-style" template tag that checks to see if a user belongs to a one or mores groups (by name).</p>
<p>Usage:
{% ifusergroup Admins %} ... {% endifusergroup %}
or
{% ifusergroup Admins Clients Programmers Managers %} ... {% else %} ... {% endifusergroup %}</p>

Вопрос полезен? Да0/Нет0
file_5157.py(2.0Кб)
None

Ответы (2):

Ответkourosh:18.06.2012
Ответ полезен? Да0/Нет0

add this to work -> from django.template import resolve_variable, NodeList

Ответkourosh:18.06.2012
Ответ полезен? Да0/Нет0

it gives me the following error Django Version: 1.4 Exception Type: NameError Exception Value: global name 'NodeList' is not defined