List Info

Thread: Help with Generic Views in Magic Removal Branch




Help with Generic Views in Magic Removal Branch
user name
2006-02-25 18:30:30
On Saturday 25 February 2006 18:25, ChaosKCW wrote:

> A dumb question, but will objects.all() cause any kind
of performance
> hit ?
>
> I mean when the code appends
QuerySet.filter(pk=object_id), will it
> condense that to a SQL statement that returns one
object or reutrn
> all obejcts then do the PK query ?

It creates a new SQL statement that returns one objects,
without ever 
having done the original query, so there is no performance
hit.  To do 
the PK query client side would mean you'd have to replicate
all the 
features of the DB in Python.

Luke

-- 
Parenthetical remarks (however relevant) are unnecessary

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Help with Generic Views in Magic Removal Branch
user name
2006-02-25 19:06:40
Hi

Thanks for your responses. Thats what I thought, just wanted
to make
sure. The all() just seems unitutive to me, but given that
Djangos
syntax is so easy, a little bit of something here and there
is no
biggie.

Thanks again.

PS I just posted a patch for the generic views on the
developers list
to add a template model name: http://code
.djangoproject.com/ticket/1399

C


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )