If the default manager adds an annotation and sets use_for_related_fields, saves can fail.
|Reported by:||benanhalt||Owned by:|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If a model has a custom manager that sets use_for_related_fields = True and overrides get_query_set() to return an annotated query set, then calling save() on instances of that model can fail with ProgrammingError: subquery has too many columns.
I am attaching a diff with a test illustrating this behavior.
Change History (5)
Changed 6 years ago by benanhalt
comment:1 Changed 6 years ago by benanhalt
- Component changed from Uncategorized to ORM aggregation
- Needs documentation unset
- Needs tests unset
- Owner nobody deleted
- Patch needs improvement unset
comment:2 follow-up: ↓ 3 Changed 6 years ago by jacob
- Resolution set to wontfix
- Status changed from new to closed