I have a ImageField()
where I have specified the upload_to
path. And it works it saves to the MEDIA_ROOT
url. However I want to change the uploaded file to some other filename.
Should I do that from the forms.py or from the models.py, and also should I override the the save function to archive that?
forms.py
class UserAvatarForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = ('avatar',)
def __init__(self, *args, **kwargs):
super(UserAvatarForm, self).__init__(*args, **kwargs)