python - Cannot resolve keyword 'items' into field. Choices are: id, name -


i using photologue create photo gallery site django. installed django-tagging virtualenv, not knowing no longer supported photologue. now, after having performed migrations, whenever try add photo or view photo, fielderror @ /admin/photologue/photo/upload_zip/ cannot resolve keyword 'items' field. choices are: id, name.

i uninstalled , reinstalled django, photologue, sqlite file, , removed django-tagging, problem persists. tried running different project uses photologue , shares virtualenv, , prompted perform same (assumedly destructive) migration.

i can't figure out have possibly changed on system if problem spans multiple projects , dependencies have been freshly installed.

exception location: /home/cameron/envs/photologue/local/lib/python2.7/site-packages/django/db/models/sql/query.py in raise_field_error, line 1389

traceback:

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 @ /admin/photologue/photo/add/ exception value: cannot resolve keyword 'items' field. choices are: id, name 

the problem seems arise fact, django-tagging somehow still present on virtualenv.

in traceback after photologue saves model, django-tagging reacts sent signal , tries update related tags:

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)) 

there tries use (apparently not existing anymore) field items, , that's error occurs.

i guess way deinstalled django-tagging on venv didn't work. did uninstalled with: pip uninstall django-tagging ?

for reference, here again comment/steps recreate venv

... if venv somehow corrupted, easiest recreate scratch:

  1. on venv do:

    env pip freeze > orig_requirements.txt

    check orig_requirements.txt , delete don't need.

  2. make new venv no site-packages , reinstall requirements:

    mkvirtualenv --no-site-packages photoenv

    pip install -r orig_requirements.txt

  3. now double check you're on venv when running django project

    workon photoenv


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -