We simply picked a number, not too large and not too small. The number 20
is now hardcoded as MAX_GET_RESULTS at the top of this file:
https://github.com/django/django/blob/master/django/db/models/query.py
Here's the discussion where the number came up:
https://groups.google.com/forum/#!topic/dj
On Sun, 14 Sep 2014 17:48:18 +0100 Ben Collier
wrote:
> So why 21, precisely?
Because its half the answer?
signature.asc
Description: PGP signature
On 2014-09-14 13:23, James Bennett wrote:
> This was something that could bite any user of Django with large
> enough QuerySets, so the behavior was changed in upstream Django to
> only show 20 objects.
[snip]
> This means that repr() on a QuerySet will never instantiate huge
> numbers of objects,
On Sun, Sep 14, 2014 at 12:48 PM, Ben Collier wrote:
> So why 21, precisely?
>
I can't find the exact changeset in which it was introduced, but I do
remember why :)
There was an incident involving a large Django installation at World
Online, where we were attempting to isolate a bug in our code
So why 21, precisely?
On 14 September 2014 16:45, Alex French wrote:
> Okay, after looking through the source code and documentation it seems
> that django uses the limit for primary key lookups as a cautionary measure
> and also to support the MultipleObjectsReturned exception in case something
Okay, after looking through the source code and documentation it seems that
django uses the limit for primary key lookups as a cautionary measure and
also to support the MultipleObjectsReturned exception in case something
goes wrong.
--
You received this message because you are subscribed to t
I realize that's how it's supposed to work, but this happens regardless of
whether or not results are printed. If you use postgres with the tutorial
project and look at the query log, you can see the limit clause applied to
primary key lookups.
--
You received this message because you are subs
On Sunday, September 14, 2014 6:35:43 AM UTC+2, Alex French wrote:
>
> I'm using Django 1.7 and I noticed something odd in my postgres query
> logs. Almost every query has a "LIMIT 21" clause, including queries of the
> type "Thing.objects.get(pk=#)", which could only ever return one row. This
>
I'm using Django 1.7 and I noticed something odd in my postgres query logs.
Almost every query has a "LIMIT 21" clause, including queries of the type
"Thing.objects.get(pk=#)", which could only ever return one row. This
behavior seems odd to me, but so far I haven't seen it come up in a place
w
9 matches
Mail list logo