'RelatedManager' object has no attribute 'file' - get_thumbnail error #90

Open
kainbacher opened this Issue Apr 2, 2013 · 2 comments

Projects

None yet

2 participants

@kainbacher

hi, if i add an image i get an error:
Exception Value: 'RelatedManager' object has no attribute 'file'
Exception Location: /Users/Roland/djangobox/bluetechnix/cmsplugin_filer_image/cms_plugins.py in get_thumbnail, line 91

cms_plugins.py

def get_thumbnail(self, context, instance):
    if instance.image:
        return instance.image.image.file.get_thumbnail(self._get_thumbnail_options(context, instance))

any ideas?

@stefanfoulis
Divio AG member

Off the top of my head: You might have some model in your project with a relation to filer.models.File or filer.models.Image that has related_name='image'.
Although django would normally complain if there are clashing related names.
I'm not quite sure why there is image.image in there. The second .image should not be necessary, as FilerImageField is a ForeignKey directly to filer.models.Image and not to filer.models.File.

Does it work if you remove the second .image?

@kainbacher

right at the moment i don't have a model with a related_name='image' but it works fine without the second .image.
thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment