Why does sorl.thumbnail ImageField fail in the admin?

Posted by Mark0978 on Stack Overflow See other posts from Stack Overflow or by Mark0978
Published on 2010-12-24T22:39:18Z Indexed on 2010/12/24 22:54 UTC
Read the original article Hit count: 352

Filed under:
|

I have code that looks like this:

from sorl.thumbnail import ImageField
class Gallery(models.Model):
    pass

class GalleryImage(models.Model):
    image = ImageField(upload_to='galleries')

In the admin:

class GalleryImageInline(admin.TabularInline):
    model = GalleryImage

class GalleryAdmin(admin.ModelAdmin):
    inlines = (GalleryImageInline,) 

If I use the sorl.thumbnail as above, it is impossible to add images in the admin. I get the validation error

Enter a list of values.

If I replace the sorl.thumbnail.ImageField with a plain django ImageField, everything works.

If I want sorl.thumbnail to clean up the cache thumbnails, I need to use it in the model, but if I use it in the model, I can't seem to add any images to need thumbnails.

Anyone else found and fixed this problem yet?

© Stack Overflow or respective owner

Related posts about django

Related posts about sorl-thumbnail