I have a model, course, with an ImageField
and FileField
so I’d like to create a folder each time the user create a course. I think I can do this before the model is saved so here is my question.
How can I access a model’s fields in a method?
Models.py
Class Course(models.Model):
Thumbnail = model.ImageField(upload_to=“...”,...)
def save(self, *args, **kwargd):
... #How can I alter here the ImageField parameters?
super().save(*args, **kwargs)