Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1745 closed defect (fixed)

[patch] Accessing many-to-many relationships without a PK value should throw exceptions

Reported by: Luke Plant Owned by: Adrian Holovaty
Component: Metasystem Version: dev
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

For background, see:
http://groups.google.com/group/django-users/browse_frm/thread/9ab2c6f7115a1c1b/6f859e5f1941f3c1#6f859e5f1941f3c1

Basically, if you access m2m fields before the object has a primary key value, you get incorrect results. The attached patch fixes this and throws a helpful exception.

It also includes a fix for a nonsense test that was discovered by the patch.

Attachments (1)

m2m_requires_pk_val.patch (1.3 KB ) - added by Luke Plant 19 years ago.

Download all attachments as: .zip

Change History (2)

by Luke Plant, 19 years ago

Attachment: m2m_requires_pk_val.patch added

comment:1 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(In [2817]) Fixed #1745 -- Accessing many-to-many relationships without a PK value now throws an exception. Thanks, Luke

Note: See TracTickets for help on using tickets.
Back to Top