我正在使用 photologue 用 django 创建一个照片库站点。我将 django-tagging 安装到我的 virtualenv 中,但不知道 photologue 不再支持它。现在,在执行迁移后,每当我尝试添加照片或查看照片时,我都会在 /admin/photologue/photo/upload_zip/ 处收到 FieldError 无法将关键字“项目”解析到字段中。选项有:id、name。
我卸载并重新安装了 django、photologue、SQLite 文件,并删除了 django-tagging,但问题仍然存在。我还尝试运行一个使用 photologue 并共享 virtualenv 的不同项目,并提示我执行相同的(假设是破坏性的)迁移。
如果问题跨越多个项目并且所有依赖项都是全新安装的,我无法弄清楚我的系统可能会发生什么变化。
异常位置:/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py in raise_field_error,第 1389 行
追溯:
Environment:
Request Method: POST
Request URL: http://localhost:8000/admin/photologue/photo/add/
Django Version: 1.7.1
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'sortedm2m',
'photologue',
'photologue_custom',
'pornsite')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
584. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
105. response = view_func(request, *args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
204. return view(request, *args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
1454. return self.changeform_view(request, None, form_url, extra_context)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
29. return bound_func(*args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
105. response = view_func(request, *args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
25. return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
394. return func(*args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in changeform_view
1405. self.save_model(request, new_object, form, not add)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in save_model
1046. obj.save()
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/photologue/models.py" in save
540. super(Photo, self).save(*args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/photologue/models.py" in save
491. super(ImageModel, self).save(*args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/base.py" in save
591. force_update=force_update, update_fields=update_fields)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base
628. update_fields=update_fields, raw=raw, using=using)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py" in send
198. response = receiver(signal=self, sender=sender, **named)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/tagging/fields.py" in _save
81. Tag.objects.update_tags(kwargs['instance'], tags)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/tagging/models.py" in update_tags
34. items__object_id=obj.pk))
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
92. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/query.py" in filter
691. return self._filter_or_exclude(False, *args, **kwargs)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/query.py" in _filter_or_exclude
709. clone.query.add_q(Q(*args, **kwargs))
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in add_q
1287. clause, require_inner = self._add_q(where_part, self.used_aliases)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in _add_q
1314. current_negated=current_negated, connector=connector)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in build_filter
1138. lookups, parts, reffed_aggregate = self.solve_lookup_type(arg)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in solve_lookup_type
1076. _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in names_to_path
1383. self.raise_field_error(opts, name)
File "/home/cameron/Envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in raise_field_error
1389. "Choices are: %s" % (name, ", ".join(available)))
Exception Type: FieldError at /admin/photologue/photo/add/
Exception Value: Cannot resolve keyword 'items' into field. Choices are: id, name