sorl-thumbnail-async
sorl-thumbnail-async copied to clipboard
Support to define THUMBNAIL_OPTIONS_DICT on per model basis
Some time we need to define different sizes based on different model. I have added the patch which will give higher importance to model level THUMBNAIL_OPTIONS_DICT
if that is not defined always fall back to the settings.OPTIONS_DICT
. How to use it:
class Image(AsyncThumbnailMixin, models.Model):
image_field_name = 'image'
THUMBNAIL_OPTIONS_DICT = {
'small': {
'geometry': '30x30',
'crop': 'center'
},
}