Hi, Am Thu, 2 Apr 2015 09:15:42 -0700 (PDT) schrieb Preston Timmons <prestontimm...@gmail.com>: > One use case is for validating address forms. We deal with a lot of > them with varying levels of validation based on country, state, zip > code, etc. Sometimes, multiple sets of address fields appear on the > same form. We can't simply reuse the fields without worrying about > disparate validation routines specified on the form in addition to the > fields. This leads to a meticulous set of mixins. It gets the job > done, but I don't think that's great api.
While Thomas' use case (issue due dates that are required for certain issue states) can be solved using clean() without major drawbacks, for your use case (re-usable address fields), I'd go for MultiValueFields[1] -- this logic does not really belong to the form. Raphael [1] https://docs.djangoproject.com/en/1.8/ref/forms/fields/#multivaluefield -- 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 django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20150408204959.6e08dc20%40kvothe. For more options, visit https://groups.google.com/d/optout.
pgpO3ul2YEB_7.pgp
Description: Digitale Signatur von OpenPGP