Django

Code

Ticket #1064 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: bruce@cubik.org Assigned to: mtredinnick
Milestone: Component: django.contrib.admin
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

onetoonefix.diff (0.7 kB) - added by bruce@cubik.org on 12/15/05 00:02:29.
Fix!

Change History

12/15/05 00:02:29 changed by bruce@cubik.org

  • attachment onetoonefix.diff added.

Fix!

12/15/05 00:11:22 changed by django@illuminosity.net

  • summary changed from ManyToManyField pointing at a model that contains a OneToOneField is broken to [patch] ManyToManyField pointing at a model that contains a OneToOneField is broken.

06/18/06 20:02:28 changed by mtredinnick

  • owner changed from adrian to mtredinnick.

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.

06/20/06 00:29:19 changed by mtredinnick

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

06/20/06 00:29:53 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

Add/Change #1064 ([patch] ManyToManyField pointing at a model that contains a OneToOneField is broken)




Change Properties
Action