It's done more like explaining a side-effect than explaining the *purpose* of
the method. It shouldn't be "notice that when you use `exists`, it has the
following effects on efficiency", but "`exists`'s entire purpose is to get
higher efficiency in situations where you don't want to access the data."


On Fri, Jan 18, 2013 at 6:08 PM, Javier Guerra Giraldez
<jav...@guerrag.com>wrote:

> On Fri, Jan 18, 2013 at 10:58 AM, Ram Rachum <r...@rachum.com> wrote:
> > I suggest copying your explanation into the documentation.
>
> it's already there:
>
> " This means that calling QuerySet.exists() is faster than
> bool(some_query_set), but not by a large degree. If some_query_set has
> not yet been evaluated, but you know that it will be at some point,
> then using some_query_set.exists() will do more overall work (one
> query for the existence check plus an extra one to later retrieve the
> results) than simply using bool(some_query_set), which retrieves the
> results and then checks if any were returned."
>
> [
> https://docs.djangoproject.com/en/1.4/ref/models/querysets/#django.db.models.query.QuerySet.exists
> ]
>
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to