#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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.e19898054fda5fbb01f7e85e65b81261%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to