I want to use ImageSpecField
of django-imagekit
for resizing image, so I don't want to create a new ImageSpecField
field for every ImageField
in my models, I want to create a new class or modelField
which contains original image and image thumbnail and instantiate this new modelField in my models for images.
for example if my model has profile_picture
field, I want to have both profile_picture
and profile_picture_thumbnail
. If my model has avatar
field I want to have both avatar
and avatar_thumbnail
So is there any way to dynamically generate these fields for models?
What is the best approach to do that?