我刚刚在我的Mezzanine CMS上安装了django-categories,我无法使用它。这是描述:
-
安装:pip install django-categories>>添加"类别"和settings.editor在settings.py>> python manage.py syncdb>> python manage.py migrate
-
我转到管理页面,然后从左侧菜单中选择类别(网址:http://localhost:8000/admin/categories/)=>因为这是第一次运行,没有类别=>我点击" +添加" =>为新类别命名=>单击“保存”,我收到以下错误:
回溯:
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/core/handlers/base.py"在get_response
- response = wrapped_callback(request,* callback_args,** callback_kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/contrib/admin/options.py"在包装器中
- return self.admin_site.admin_view(view)(* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/utils/decorators.py"在_wrapped_view
- response = view_func(request,* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/views/decorators/cache.py"在_wrapped_view_func
中
- response = view_func(request,* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/contrib/admin/sites.py"在内心
- 返回视图(请求,* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/utils/decorators.py"在_wrapper
- return bound_func(* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/utils/decorators.py"在_wrapped_view
- response = view_func(request,* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/utils/decorators.py"在bound_func
中
- return func(self,* args2,** kwargs2)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/db/transaction.py"在内心
- return func(* args,** kwargs)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/contrib/admin/options.py"在add_view
- if form.is_valid():
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/forms/forms.py" in is_valid
- 返回self.is_bound而不是bool(self.errors)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/forms/forms.py"错误
- self.full_clean()
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/forms/forms.py"在full_clean
- self._clean_form()
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/forms/forms.py"在_clean_form
- self.cleaned_data = self.clean()
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/categories/base.py"在干净
- decendant_ids = self.instance.get_descendants()。values_list(' id',flat = True)
文件" /home/user1/.envs/bs-3/local/lib/python2.7/site-packages/mptt/models.py"在_fn
- %{&#39; function&#39 ;: func。 name ,&#39; class&#39;:self。 class 。 name < /强>}
异常类型:/ admin / categories / category / add /的ValueError
异常值:无法在未保存的类别实例上调用get_descendants
有什么想法吗?
谢谢!
GG