Is there a specific reason that newforms' Fields are using an
inconsistent name? If not, I suggest that these all be normalized to
"maxlength" and "minlength".
Thanks.
[1] - http://code.djangoproject.com/browser/django/trunk/django/newforms/fields.py#L89
[2] - http://www.djangoproject.com/documentation/model_api/#charfield
[3] - http://www.w3.org/TR/html401/interact/forms.html#adef-maxlength
--
Brad Fults
Actually, the plan over the next couple releases is to normalize to
"max_length" everywhere; we'll probably start out by supporting either
version on models, and then deprecate "maxlength" and remove it
eventually.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
On Mar 21, 5:27 am, "James Bennett" <ubernost...@gmail.com> wrote:
> On 3/20/07, Brad Fults <bfu...@gmail.com> wrote:
>
> > Is there a specific reason that newforms' Fields are using an
> > inconsistent name? If not, I suggest that these all be normalized to
> > "maxlength" and "minlength".
>
> Actually, the plan over the next couple releases is to normalize to
> "max_length" everywhere; we'll probably start out by supporting either
> version on models, and then deprecate "maxlength" and remove it
> eventually.
This even has a ticket which (although I think is pretty solid) could
probably do with some real-world testing!
http://code.djangoproject.com/ticket/2101
So if you want to help out with this normalization Brad (or anyone
else), patch your local copy with that and report back.
Hey Brad,
This thread will answer your question:
http://groups.google.com/group/django-users/browse_thread/thread/a4e09b7b027b56bb/9aaeda1ea5bc87eb
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
OK, at least it's an intended change. :)
Though, now I'm concerned that max_length on the Field is different
from maxlength (the HTML attribute) on the Widget, which are
frequently specified *right next to* one another. This seems
undesirable.
Thoughts?
--
Brad Fults
It's not that "frequent" that you have to explicitly specify the
maxlength html attribute - CharField sets it for you automatically.