Django

Code

Ticket #7666 (closed: fixed)

Opened 5 months ago

Last modified 4 months ago

Default managers should not restrict access to single related objects

Reported by: jkocherhans Assigned to: jacob
Milestone: 1.0 alpha Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

We currently use the default manager when looking up a single related object, but this can make the related object inaccessible. See the attached test for details.

Attachments

7666-failing-test.diff (1.5 kB) - added by jkocherhans on 07/07/08 19:05:40.
7666.patch (2.5 kB) - added by noodslane on 07/10/08 23:38:58.

Change History

07/07/08 18:52:05 changed by jkocherhans

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

07/07/08 19:05:40 changed by jkocherhans

  • attachment 7666-failing-test.diff added.

07/10/08 23:38:58 changed by noodslane

  • attachment 7666.patch added.

07/10/08 23:41:02 changed by noodslane

Simple patch; does not address Ivan Sagalaev's concerns in the django-dev thread.

07/10/08 23:41:46 changed by noodslane

  • has_patch set to 1.

Simple patch; does not address Ivan Sagalaev's concerns in the django-dev thread.

07/19/08 20:30:10 changed by nicklane

  • stage changed from Design decision needed to Accepted.

Changed to accepted based on previous comments on django-dev.

For reference: http://groups.google.com/group/django-developers/browse_thread/thread/619f44e1ae68da1a/c94c12f5db53c1a1

07/21/08 10:11:53 changed by jacob

  • owner changed from nobody to jacob.
  • status changed from new to assigned.

07/21/08 10:41:21 changed by jacob

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

(In [8017]) FIxed #7666: use a bare queryset when accessing single related objects so that the related objects never become inaccessible.

07/22/08 15:30:30 changed by magneto

  • status changed from closed to reopened.
  • resolution deleted.

Yikes guys

this change, effectively kills "get" overloading in Managers

i can think of a million reasons way this is necessary, caching these 'gets' in some local/thread/memcached world 'special gets' (deleted flags and permissions) database sharding, etc, etc

i hope y'all re think this before Versions 1, so i'm reopening this as since the 'QuerySet?' approach you took has no ability to be overloaded

07/22/08 16:09:22 changed by ElliottM

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

The problem described in the ticket is fixed, please create a new ticket for the new problem.


Add/Change #7666 (Default managers should not restrict access to single related objects)




Change Properties
Action