Cannot specify 'pk' in model default ordering
|Reported by:||anonymous||Owned by:||gruszczy|
|Component:||Database layer (models, ORM)||Version:||1.1|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I wanted to make an explicit default ordering over a model's primary key (it does make sense in my app), but manage.py validate complains:
"ordering" refers to "pk", a field that doesn't exist.
Specifying 'id' is fine with it.
Change History (7)
comment:1 Changed 4 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted