On Thu, Sep 29, 2011 at 4:40 PM, Florian Apolloner <f.apollo...@gmail.com>wrote:

>
>
> On Tuesday, September 27, 2011 11:37:06 PM UTC+2, Peter wrote:
>>
>> I'd just like to chime in to say this should definitely be part of
>> core - it's a common requirement, and whilst it could be a third party
>> app, it certainly feels much more at home in core.
>>
>
> +1, especially if it works with pagination (which is often not the case for
> 3rd party apps which fall back to raw sql or so…)
>
>
>> On Sep 27, 1:13 pm, Luke Plant <l.pla...@cantab.net> wrote:
>> > For me, QuerySet is at a level of abstraction where I don't think it
>> > guarantees a single query. We have quite a bit of precedent here I
>> think:
>>
>> I also agree on this - many ORMs give the option to fetch objects
>> using a separate select (I'm thinking for example hibernates
>> "FetchMode.SELECT"). I think if you explicitly use this then you
>> probably need to understand what it does like anything else.
>>
>
> Jupp, btw don't we even already have some cases where eg assertNumQueries
> fails since mysql executes more queries? (I remember something like that on
> #django-dev -- or I am completely dumb :))
>
> Cheers,
> Florian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/cQKYc4OPQaAJ.
>
> 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.
>

When I did this externally a number of years ago, I basically subclassed
ManyToManyField, overrode a bunch of code (quite a bit of copy paste as I
recall), and it's related manager and made it return a custom queryset,
which used a cache off of the object, which was populated by another custom
queryset which overrode iterator() in order to do the bulk loading.

Alex


-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero

-- 
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