简体   繁体   中英

What should I use instead of deprecated ImageWithThumbnailsField of django-sorl?

I'm struggling with ImageWithThumbnailsField which seems deprecated. What should I use instead? I don't want to rewrite large parts of my project as I'm doing only slight bugfixing and updating...

Error I'm getting:

File "/var/www/project/images/models.py", line 6, in from sorl.thumbnail.fields import ImageWithThumbnailsField ImportError: cannot import name ImageWithThumbnailsField

That must have been a very old version of sorl-thumbnail you were using. I'm not sure what that field actually did for you, but now all you have is ImageField . It serves to automatically update the thumbnail registry if you change or delete it and adds a thumbnail of the assigned image next to the form field in the admin.

If you're missing any other functionality, it would be best to actually ask what you can do about that particular functionality specifically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM