sorl-thumbnail-async icon indicating copy to clipboard operation
sorl-thumbnail-async copied to clipboard

Support to define THUMBNAIL_OPTIONS_DICT on per model basis

Open intellisense opened this issue 9 years ago • 0 comments

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'
        },
    } 

intellisense avatar Aug 11 '14 22:08 intellisense