#10237 closed (fixed)
Symmetry is lost when inheriting a self-referential m2m field
| Reported by: | Justin Lilly | Owned by: | Justin Lilly |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.0 |
| Severity: | Keywords: | mti, m2m, inheritance | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When extending a model (via MTI, not ABC), the implicit symmetrical=True reference wasn't being maintained because the current class was being checked against the parent (which weren't the same type). By changing this to an isinstance call instead of a __class__ comparison, it properly compares to parent objects.
Attachments (1)
Change History (5)
by , 17 years ago
| Attachment: | m2m-inheritance.diff added |
|---|
comment:1 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Patch applies and works correctly for me, seems to solve the problem correctly(that code was originally from way back to magic-removal).
comment:2 by , 17 years ago
| milestone: | → 1.1 |
|---|
comment:3 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Contains a fix and regression tests for the reported bug.