Dne čtvrtek 18. dubna 2019 10:56:55 UTC+2 Aymeric Augustin napsal(a): > > Le mer. 17 avr. 2019 à 22:32, Curtis Maloney <[email protected] > <javascript:>> a écrit : > > > It's mostly for performance reasons, since validation can be expensive. >> >> Really? My memory was that it was (a) backward compatibility [model >> validation was added later], and (b) practicality [try catching >> everywhere in your code you save a model, and enforce catching >> validation exceptions there]. >> > > These arguments are absolutely valid. > > I can't say for sure if some concerns ranked higher than others. >
The question is if there is consensus that model validation should really be opt-in. As a veteran Django user, I am quite used to it but as I work on financial project (with strong requirements on data consistency) with a team of senior developers kind of new to Django I face a lot of confusion about why does Django let us save invalid data (actually last week I spent almost 3 days on fixes caused forgotten calls to full_clean and on data migration to clean up the mess). If it was possible, e.g. in settings, to force model validation in save(), it would help us a lot. Vaclav -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6c7fc8f6-1329-456a-985c-5f0771084b1f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
