[Django]-Why, in Model.full_clean, is clean_fields called before clean?

8đź‘Ť

Why would it be “more reasonable”? As it’s name describes, clean_fields is designed to clean each field individually, whereas the purpose of clean is only to validate field interactions. For example, one field can be blank only if another field is set, etc. The clean_fields method is called first to ensure that you can actually validate these interactions; if the fields have errors in general, it’s pointless to validate them in conjunction.

👤Chris Pratt

Leave a comment