#23931: db_manager() method doesn't increment creation_counter
----------------------------------------------+--------------------
     Reporter:  rhettg                        |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.7
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  1
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 Creating a manager with the db_manager() method can cause unexpected
 behavior. Consider the following:

 {{{
 class MyModel(models.Model):
     objects = models.Manager()
     ro_objects = objects.db_manager('ro')
 }}}

 There are certain situations where ro_objects becomes the 'default'
 manager of the object. Both of these managers have the same
 'creation_counter'.

 Patch is here:
 https://github.com/rhettg/django/compare/db_manager_creation_counter?expand=1

--
Ticket URL: <https://code.djangoproject.com/ticket/23931>
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/049.08d01f237a9d8965aca78e07243b8a50%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to