[Django] #26127: ReverseManyToOneDescriptor doesn't respect use_for_related_fields attribute

12 views
Skip to first unread message

Django

unread,
Jan 22, 2016, 3:17:01 PM1/22/16
to django-...@googlegroups.com
#26127: ReverseManyToOneDescriptor doesn't respect use_for_related_fields attribute
----------------------------------------------+--------------------
Reporter: rerobins | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
The other two descriptors respect the flag and will use the _base_manager
if the manager has use_for_related_fields set to false. The
ReverseManyToOneDescriptor always uses the _default_manager regardless of
whether it is supposed to or not.

{{{
def related_manager_cls(self):
return create_reverse_many_to_one_manager(
self.rel.related_model._default_manager.__class__,
self.rel,
)
}}}

Or am I misunderstanding:

If this attribute is set on the default manager for a model (only the
default manager is considered in these situations), Django will use that
class whenever it needs to automatically create a manager for the class.
Otherwise, it will use django.db.models.Manager.

--
Ticket URL: <https://code.djangoproject.com/ticket/26127>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 22, 2016, 3:31:02 PM1/22/16
to django-...@googlegroups.com
#26127: ReverseManyToOneDescriptor doesn't respect use_for_related_fields attribute
-------------------------------------+-------------------------------------
Reporter: rerobins | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0


Comment:

Duplicate of #14891 I believe.

--
Ticket URL: <https://code.djangoproject.com/ticket/26127#comment:1>

Reply all
Reply to author
Forward
0 new messages