maxlength should be max_length
|Reported by:||nirvdrum||Owned by:||Adrian Holovaty|
|Component:||Database layer (models, ORM)||Version:|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a feeling this isn't going to go over too well, but the "maxlength" parameter for the various field types should be "max_length." This really isn't an issue about cosmetics, but rather one about consistency. FloatField has "max_digits" and ForeignKey has "max_num_in_admin", while CharField, CommaSeparatedIntegerField, and SlugField have "maxlength." Many times I find myself going to type the parameter one way only to find it should be the other way. It's one of those little gotchas in the framework.
My personal recommendation would be to add the "max_length" parameter without removing "maxlength." This way, backwards-compatibility can be maintained while promoting consistency moving forward. The best of both worlds.
Change History (21)
comment:3 Changed 10 years ago by
|Keywords:||maxlength max_length added|
|Triage Stage:||Unreviewed → Design decision needed|