LINUX.ORG.RU

[Django] Переменные в шаблонах

 


0

1

Возникла небольшая проблема с сохранением вывода page_attribute в переменную. Вариант:

{% page_attribute "slug" request.current_page.parent as parent_slug %}
завершается ошибкой:
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 283, in run
    self.result = application(self.environ, self.start_response)

  File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 273, in __call__
    response = self.get_response(request)

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 169, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 203, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)

  File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 59, in technical_500_response
    html = reporter.get_traceback_html()

  File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 112, in get_traceback_html
    self.get_template_exception_info()

  File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 175, in get_template_exception_info
    'message': self.exc_value.args[0],

IndexError: tuple index out of range
Куда копать, можно-ли page_attribute, например, в with запихать, или тут надо что-то изменить? Django 1.3, Django-CMS 2.1.3



Последнее исправление: igor87 (всего исправлений: 1)

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.