Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Seeing error: type object 'Clipboard' has no attribute 'base_objects' #278

Open
chrisfong opened this Issue · 8 comments

7 participants

Chris Stefan Foulis Juho Rutila Eric Ressler Muhia Njoroge Thiago Paiva Brito Andrzej Kostanski
Chris

Getting this error when clicking into a folder in the Filer plugin in Django Admin. Can someone point me in the right direction? Thanks.

Environment:


Request Method: GET
Request URL: http://app.locals/admin/filer/folder/1/list/

Django Version: 1.4.3
Python Version: 2.7.2
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'helpers.template',
 'cms',
 'mptt',
 'menus',
 'cms.plugins.text',
 'cms.plugins.picture',
 'cms.plugins.link',
 'cms.plugins.file',
 'cms.plugins.snippet',
 'cms.plugins.googlemap',
 'sekizai',
 'cmsplugin_markup',
 'filer',
 'easy_thumbnails',
 'south',
 'app')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'helpers.middleware.VisitorTokenMiddleware',
 'helpers.middleware.AdminLocaleURLMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py" in inner
  196.             return view(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/filer/admin/folderadmin.py" in directory_listing
  293.         for f in file_qs:
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _result_iter
  118.                 self._fill_cache()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _fill_cache
  892.                     self._result_cache.append(self._iter.next())
File "/usr/local/lib/python2.7/dist-packages/polymorphic/query.py" in iterator
  243.             real_results = self._get_real_instances(base_result_objects)
File "/usr/local/lib/python2.7/dist-packages/polymorphic/query.py" in _get_real_instances
  174.             qs = modelclass.base_objects.filter(pk__in=idlist) # use pk__in instead ####

Exception Type: AttributeError at /admin/filer/folder/1/list/
Exception Value: type object 'Clipboard' has no attribute 'base_objects'
Stefan Foulis

Sorry for the late response @chrisfong . Did you find a solution? I've not encountered this error before and can't reproduce it.

What version of django and django_polymorphic are you using?

Juho Rutila

I am having this same issue with
django-filer 0.9.3
django-polymorphic 0.4.0

I do not have the reproduction steps yet, though.

Stefan Foulis
Owner

I suspect his has something to do with django ContentType pks being mixed up. Maybe after loading a dbdump?

Juho Rutila

Definitely. I had wrong polymorphic_ctype_id in filer_file table.
I did do some database dumping and restoring and must have screwed it there.
Everything works now that I changed the polymorphic_ctype_id.

Eric Ressler

I just ran into this same issue after trying to load data from a dumpdata output. Doing a dump data using natural keys will also prevent this issue from occurring.

./manage.py dumpdata filer > filer.json --natural --indent 4
Muhia Njoroge

Hello Guys,

I have the same problem with a django shop app, after doing the a restore, how exactly do i fix this in the database, how to change the polymorphic_ctype_id,

Thanks guys

Thiago Paiva Brito

It appears that setting the "polymorphic_ctype_id" to the ContentType relative to filer.file works.

Andrzej Kostanski

For me following the hint of eressler about using --natural was the way to go. THANKS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.