Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1064 closed defect (fixed)

[patch] ManyToManyField pointing at a model that contains a OneToOneField is broken

Reported by: bruce@… Owned by: Malcolm Tredinnick
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you have a ManyToManyField pointing at a model that uses a OneToOneField, then the model with the OneToOneField has no attribute "id" which causes the code in method_set_many_to_many to fail due to it relying on the presence of an attribute "id".

Luminosity helped figure out the correct fix and I will attach the patch that fixes the problem.

Attachments (1)

onetoonefix.diff (698 bytes ) - added by bruce@… 19 years ago.
Fix!

Download all attachments as: .zip

Change History (5)

by bruce@…, 19 years ago

Attachment: onetoonefix.diff added

Fix!

comment:1 by django@…, 19 years ago

Summary: ManyToManyField pointing at a model that contains a OneToOneField is broken[patch] ManyToManyField pointing at a model that contains a OneToOneField is broken

comment:2 by Malcolm Tredinnick, 19 years ago

Owner: changed from Adrian Holovaty to Malcolm Tredinnick

Looks like this has been fixed "en passant", but I'll leave it open until I can find a place to put the test that proves this.

comment:3 by Malcolm Tredinnick, 19 years ago

(In [3176]) Added regressions tests to ensure that one-to-one and many-to-many fields
continue to interact properly. Refs #1064. Refs #1506.

comment:4 by Malcolm Tredinnick, 19 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top