Reverse generic relation to a model inheriting from the model defining a generic relation confuses flush
|Reported by:||pronik||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||1.3|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Please look into attached file, I've created a minimal test project for this bug. You'll have to include your database credentials in settings.py before you try it.
Let's say we have model with a generic relation (e.g. django.contrib.comments.models.Comment) and a model deriving from it (e.g. OtherComment). Now, if a reverse generic relation to OtherComment is defined, it would correctly work and point to a list of OtherComment instances. However, flush would now try to reset the sequence on id field of OtherComment which does not exist (OtherComment only has comment_ptr_id) while resetting id on Comment would be correct.
Change History (4)
Changed 4 years ago by pronik
comment:1 Changed 4 years ago by pronik
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 4 years ago by aaugustin
- Component changed from Uncategorized to Core (Management commands)
- Triage Stage changed from Unreviewed to Accepted