In the newforms module, certain Fields have max_length and min_length attributes [1]. This seems strange because the models API uses maxlength [2] (note the lack of underscore), as does HTML [3], seen when creating Widgets in newforms.
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".
> 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.
-- "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.
> In the newforms module, certain Fields have max_length and min_length > attributes [1]. This seems strange because the models API uses > maxlength [2] (note the lack of underscore), as does HTML [3], seen > when creating Widgets in newforms.
> 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".
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.
On Mar 21, 9:03 am, "Brad Fults" <bfu...@gmail.com> wrote:
> 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.
It's not that "frequent" that you have to explicitly specify the maxlength html attribute - CharField sets it for you automatically.