[Django]-Are pre-save signals handled before the clean method in Django?

5đź‘Ť

âś…

According to the django docs: “This is sent at the beginning of a model’s save() method.” You can find this here: https://docs.djangoproject.com/en/2.2/ref/signals/#pre-save and https://docs.djangoproject.com/en/2.2/topics/signals/#connecting-to-signals-sent-by-specific-senders

The clean method works as a validation which means it always runs before the save method, you can find more information about this here: https://docs.djangoproject.com/en/2.2/ref/forms/validation/#form-and-field-validation

You can also validate this on the Django admin code: https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1545

👤rsarai

Leave a comment