On Fri, 2009-01-16 at 13:21 -0800, cptnwinky wrote:
[...]
> I'm trying to perform a icontains search on the name field of the
> Torrent class. I need it to also return, with each result, it's
> corresponding trackers, seeds, leeches and downloads. Here is the
> relevant line in my view...
> 
> result = Torrent.objects.filter(name__icontains=query).select_related
> ()
> 
> I've even tried specifying in select_related which exact tables and
> fields I want returned however, only the results from Torrent table is
> returned. Here is a sample of whats returned for the query
> 'x360' (sorry it's not pretty)...

At no point in this fairly detailed description have you mentioned what
is actually going wrong. So what is the problem you are seeing?

If you're just starting out developing something, forget about using
select_related(). It doesn't change the results you see. It only
decreases the number of database queries in some cases and that's the
kind of optimisation that will generally be done later in the process.
If you're trying to get something working, select_related() is only
adding noise to the process, not helping at all.

Regards,
Malcolm



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