Django

Code

Ticket #1745 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: lukeplant Assigned to: adrian
Milestone: Component: Metasystem
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

m2m_requires_pk_val.patch (1.3 kB) - added by lukeplant on 05/02/06 14:24:41.

Change History

05/02/06 14:24:41 changed by lukeplant

  • attachment m2m_requires_pk_val.patch added.

05/02/06 14:51:43 changed by adrian

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

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


Add/Change #1745 ([patch] Accessing many-to-many relationships without a PK value should throw exceptions)




Change Properties
Action