#22349: RawQuerySet doesn't implement __len__, __bool__
----------------------------------------------+--------------------
     Reporter:  cdestigter                    |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  master
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 RawQuerySet should mirror QuerySet behaviour where possible.

 However, `RawQuerySet.__bool__` always returns True, instead of evaluating
 the query results and checking the length is nonzero.

 `RawQuerySet.__len__` doesn't work at all:

     *** TypeError: object of type 'RawQuerySet' has no len()

 This is not intuitive since it's not how QuerySet works. It basically
 means that you have to cast RawQuerySet to a list before doing much with
 its results.

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

Reply via email to