#22817: Missing custom methods on EmptyQuerySet
-------------------------------------+-------------------------------------
     Reporter:  benjaoming           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.6
  (models, ORM)                      |               Resolution:  invalid
     Severity:  Release blocker      |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by mjtamlyn):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 I agree with Loic's assessment. I would like to see an actionable failing
 test to allow this to move forwards.

 This comment: https://code.djangoproject.com/ticket/22817#comment:8 is not
 in my mind a bug - just because a model has a custom manager with a custom
 method, if you create an `EmptyManager` for that model it should not work.
 For example this code clearly should behave as I've shown.
 {{{
 >>> from testapp import models
 >>> from django.db.models.manager import Manager
 >>> MyModel.objects.custom_method()
 ... [<some>, <qs>]
 >>> manager=Manager(models.MyModel)
 >>> manager.custom_method()
 Traceback (most recent call last):
   File "<input>", line 1, in <module>
 AttributeError: 'Manager' object has no attribute 'custom_method'
 }}}

 So EmptyManager should have the same issues.

 I'm closing this as invalid for now. If there is a genuine bug here,
 please reopen or add a new report with a clearer description of the
 problem.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22817#comment:11>
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/068.8a617865bd6a439a0ca3ebfb595786d8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to