Django

Code

Ticket #5871 (closed: fixed)

Opened 8 months ago

Last modified 7 months ago

Allow error_messages to be specified for form types in localflavor.nl.forms

Reported by: smn Assigned to: nobody
Milestone: Component: django.contrib.localflavor
Version: SVN Keywords: nl error_messages
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The current implementation ignores the values in self.error_messages, patch & tests included in attached diff.

Attachments

localflavor.nl.error_mesages.diff (3.3 kB) - added by smn on 11/03/07 18:45:02.
diff with changes in code & test
localflavor.error_messages.patch (54.5 kB) - added by Jan Rademaker <j.rademaker@gmail.com> on 12/16/07 14:29:11.

Change History

11/03/07 18:45:02 changed by smn

  • attachment localflavor.nl.error_mesages.diff added.

diff with changes in code & test

12/02/07 18:59:54 changed by Simon G <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

12/10/07 19:52:08 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Ready for checkin to Accepted.

Don't require the user of a field to always have to specify an error message, when there is usually a perfectly good default available. In other words, put back the default error messages and just leave the change that allows overriding. You don't want to make the most common use-case harder just to favour customisation.

12/16/07 14:29:11 changed by Jan Rademaker <j.rademaker@gmail.com>

  • attachment localflavor.error_messages.patch added.

12/16/07 14:32:11 changed by Jan Rademaker <j.rademaker@gmail.com>

  • needs_better_patch deleted.

I've moved all the hardcoded error messages in the localflavor module (not just the Dutch) to the Field's default_error_messages attribute.

12/16/07 14:48:04 changed by SmileyChris

  • stage changed from Accepted to Ready for checkin.

Nice. Good job, Jan!

12/17/07 02:05:28 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [6926]) Fixed #5871 -- Factored out the validation errors in localflavor form fields. Brings them into line with the standard newforms fields. Patch from Jan Rademaker.


Add/Change #5871 (Allow error_messages to be specified for form types in localflavor.nl.forms)




Change Properties
Action