grr @ google groups for not showing me that this had already been
answered...

On Apr 2, 10:04 am, bob84123 <ama...@gmail.com> wrote:
> You probably want to check out 
> select_related:http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4
>
> On Apr 1, 7:00 am, Federico Capoano <nemesis.des...@libero.it> wrote:
>
>
>
> > Hello to all,
>
> > has been a while i've been wondering how to optimize Django's queries
> > to the database, for example by setting it to use JOIN to retrieve
> > foreign keys instead of multiple selects.
>
> > for example if I have a blog object that has a category foreign key
> > and I write in a template
>
> > {{ blog.category.slug }}
>
> > I get another query to select the category.
>
> > Is there a way I can use a JOIN instead to avoid multiple queries?
>
> > Does this have sense for performance optimization?
>
> > Thanks
> > Federico

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

Reply via email to