#Custom ImageField to modify the image using pillow before saving
5 messages · Page 1 of 1 (latest)
Custom ImageField to modify the image using pillow before saving
You should probably do it in the save method rather than a custom field
Just override the save method in the class
You could also subclass your ImageField
from django.db.models import ImageField
class MyImageField(ImageField):
def __init__(self, *args, **kwargs):
....
super().__init__(*args, **kwargs)
....
https://github.com/django/django/blob/main/django/db/models/fields/files.py
Line 382