On April 4, 2021 6:33:54 PM CDT, Mike Dewhirst <miked@dewhirst.com.au> wrote:
Is it sensible to generally call self.clean() in a model's save() method
prior to calling super().save()
Until now I have been calling clean() deliberately prior to calling
save() but I have a lot of models where save() pre-processes data just
prior to calling the model's super().save(*args, **kwargs)
I feel as though it would more robust to pre-process the data, then call
self.clean() and finally make the super call.
Thanks for any advice.
Cheers
Mike
No comments:
Post a Comment