2

当我打开点击 cms-pages 时,显示错误..

File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/contrib/admin/options.py", line 307, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/utils/decorators.py", line 93, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/views/decorators/cache.py", line 79, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/contrib/admin/sites.py", line 197, in inner
    return view(request, *args, **kwargs)

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/django_cms-2.2-py2.6.egg/cms/admin/pageadmin.py", line 657, in changelist_view
    cl.set_items(request)

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/django_cms-2.2-py2.6.egg/cms/admin/change_list.py", line 198, in set_items
    children[-1].last = False

  File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/query.py", line 157, in __getitem__
    "Negative indexing is not supported."

AssertionError: Negative indexing is not supported.
4

2 回答 2

2

这主要发生在您在空列表上尝试一些与索引相关的操作时。例如。

` somelist=[]

` last_element = somelist[len(last_element)-1]
于 2019-07-23T15:09:47.080 回答
1

看起来您在 django-cms 中遇到了这个问题。现在已修复,因此您可以升级到最新版本,或手动应用补丁。

您可能需要同时将 django-mptt 升级到 0.5.2。

于 2012-10-16T10:15:58.913 回答