On 06/21/2011 12:17 AM, Ian Clelland wrote:
On Mon, Jun 20, 2011 at 1:49 PM, Shawn Milochik <sh...@milochik.com <mailto:sh...@milochik.com>> wrote:

    I know that, whenever someone finds a "bug" in Django they're
    usually doing something incorrectly. Hopefully someone will point
    out what I need to do to make this work.


I don't know if it's considered 'correct' or not, but the max_value constructor parameter is only used at instantiation time, to add a validator to the field.

You can easily add the validator manually in your own constructor if you need to. You may also want to set the max_value attribute, if you use it elsewhere, but it is not used internally by the form machinery.


Ian,

Considering that other things, such as setting 'initial' values and widgets work after the super().__init__() and that it's impossible to do them before said __init__, I think it's definitely a bug. And considering that the max_value lives beyond that point but isn't enforced certainly violates the "least surprising" rule.

Shawn

--
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.

Reply via email to