select_related() info moved: http://groups-beta.google.com/group/django-developers/browse_thread/thread/400bcdee7fedbb15?hl=en
On Jan 10, 8:37 am, "David Cramer" <[EMAIL PROTECTED]> wrote: > http://dpaste.com/hold/4539/ > > I think I still have an issue with related fields that werent included > in the query > > On Jan 10, 8:15 am, "David Cramer" <[EMAIL PROTECTED]> wrote: > > > Use this paste instead, I found an issue :) > > >http://dpaste.com/hold/4537/ > > > On Jan 10, 6:41 am, "David Cramer" <[EMAIL PROTECTED]> wrote: > > > > Alright, anyways, if someone wants to test this, it worked 100% for me, > > > the updated select_related(). I'm not sure if we're updated with the > > > latest nightly but ill try to get that done today. > > > >http://dpaste.com/4536/ > > > > This replaces django/db/query.py and adds two arguments for > > > select_related(): > > > > depth=N, the recursion depth, by default, infinite, follows any key > > > where blank isn't True > > > fields=[], a list of fields, right now only supports fields from the > > > base table. I'd like to extend this to be able to do > > > relatedfield__fieldname, as well. if fields is not empty it will change > > > depth to 1 > > > > On Jan 10, 5:27 am, Cliff Wells <[EMAIL PROTECTED]> wrote: > > > > > David Cramer wrote: > > > > > While working on my select_related changes, I noticed that the db > > > > > backend was doing COUNT(*) for .count().. why? > > > > > > I've changed it on my local copy to count the id column, but unless > > > > > anyone can give me a specific reason, as far as I recall, it's faster > > > > > to just count on the id column.I would expect any non-broken database > > > > > server to optimize this to count > > > > using the primary key, so I doubt that change will make any difference. > > > > > Regards, > > > > Cliff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---