-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Sorl Thumbnail with Django Rest Framework #517
Comments
This works:
and |
Thank you. Hope Sorl Thumbnail support for DRF in the future :) |
Can you put it in the documentation? |
BTW, I've found a useful package for DRF: https://github.com/dessibelle/sorl-thumbnail-serializer-field |
@kidig Can you put it at documentation? |
@kidig I've found that this library slows down my app significantly. The HyperlinkedSorlImageField generates an additional query to the db and another to the cache (thourgh get_thumbnail). So if you have a simple m2m relationship with ex. 100 images and the image serializer has 2 HyperlinkedSorlImageField (ex one for the thumbnail and one large), it would create an additional 200 queries. |
@maxim25 |
How can I use sorl thumbnail with DRF? I follow instruction Low API: http://sorl-thumbnail.readthedocs.io/en/latest/examples.html#low-level-api-examples and get error: my_file is not defined in model. Please help me.
The text was updated successfully, but these errors were encountered: