Opened 6 years ago
Closed 6 years ago
#29756 closed Bug (fixed)
Missing information about model field name restriction
Reported by: | zdpx | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.1 |
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
Documentation available at https://docs.djangoproject.com/en/2.1/topics/db/models/#field-name-restrictions says, that there are only 2 restrictions on naming model fields:
- A field name cannot be a Python reserved word
- A field name cannot contain more than one underscore in a row
I've found another restriction: field name can't ends with underscore, because it generates error during making migrations:
(fields.E001) Field names must not end with an underscore.
Change History (2)
comment:1 by , 6 years ago
Summary: | Missing information about → Missing information about model field name restriction |
---|
comment:2 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In d483a5f: