Opened 10 years ago
Closed 10 years ago
#23683 closed Bug (invalid)
CharField's max_length is Incorrectly Listed as Optional in Documentation
Reported by: | Jeremy | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The documentation (for all currently documented versions of Django) on the CharField class states that it:
Has two optional arguments for validation: max_length min_length
However, if you actually try to create a CharField without a max_length Django will complain:
"some_field": CharFields require a "max_length" attribute that is a positive integer.
So, it seems that the max_length arg is required by Django, but listed as optional in the documentation, and thus it appears the documentation requires an update.
Note:
See TracTickets
for help on using tickets.
You are mixing the form field documentation with the model field documentation:
https://docs.djangoproject.com/en/dev/ref/forms/fields/#charfield
https://docs.djangoproject.com/en/dev/ref/models/fields/#charfield