I understand your point, but how i do if i dont want to show the %s in my custom error message? :S
On Fri, Apr 10, 2009 at 12:22 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Fri, 2009-04-10 at 00:07 -0300, emonk wrote: > > I do not understand that these messages are not working as if the > > other > > Who care if i talk about lenght, what happen if i talk about range of > > numbers? > > I wrote that you need to accept a format parameter in the error messages > (the "%s"). Have a look at the original messages you are trying to to > replace (in the file I pointed you to) and you'll see what I mean. I > also told you what the parameter is for (it contains the maximum or > minimum value allowed in the field). This means your error message for > those cases must use the maximum and minimum values in the string it > outputs. If that's not appropriate, then this isn't the right form field > to be using. > > > That should be work just like the message "invalid" . > > No they shouldn't. The error messages you are replacing are for max- and > min-value violations are specialised messages. They are giving the user > the necessary information to correct their error by providing the > maximum and minimum values. > > The "invalid" error is much more generic and used when there isn't > something more specific available. You can't just guess at how things > should behave and then complain when it doesn't work like that. You have > to allow for the possibility that it's your guess which is wrong. > > Regards, > Malcolm > > > > > > -- --- Key fingerprint = 0CCB D0F6 47F2 5F70 6F40 53D3 7537 A0E4 94FC 40EE ---------------------------------- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---