Hi Karol, On 05/02/2012 08:13 AM, Karol Sikora wrote:
According to my ticket: https://code.djangoproject.com/ticket/18237 and previous one eg.: https://code.djangoproject.com/ticket/13693 I would to discuss wider this case. IMHO redefining field in model form subclass to set custom error messages is a hardly DRY violation. Currently we have error_messages parameter in model fields definition, why not use them as default(it custom messages are given in fields definition) in model form? As I know these messages are use in admin, so there is the most intuitive way. There are *model* forms, so by default getting error messages form error_messages in model definition is IMHO the best way. Another option is something like in this blog: http://blog.brendel.com/2012/01/django-modelforms-setting-any-field.html I don't believe that redefining fields in subclass of model form is the best way and that all developers has the same opinion.
I agree with jezdez that a Meta option as outlined in that blog post is not good, but personally I do agree that #13693 should be reopened and accepted. Honza outlined some valid specific concerns on that ticket, but IMO (and as he says himself) they are addressable concerns that should be taken into account by someone working on a patch, they are not a reason to close the ticket.
Carl -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.