On Thu, 2008-04-24 at 15:29 -0700, jonknee wrote:
> > Look at the 'tables' and 'where' parameters to the extra() method on
> > querysets.
> >
> 
> I got very close with the tables parameter, but it always adds in a
> comma between the existing INNER JOIN statements and the one I'm
> trying to add (which leads to a MySQL error). That makes sense because
> its meant for tables, but there isn't a join parameter to utilize.

You don't need a join parameter for inner joins. "foo INNER JOIN bar ON
foo.id=bar.id" is exactly equivalent to

        FROM foo, bar WHERE foo.id=bar.id
        
So use extra(tables=..., where=...).

A number of databases actually convert certain joins of the first type
into the second type because it allows for optimisation opportunities.
You do need join types for the various types of outer joins, but that
isn't the purpose of extra().

Regards,
Malcolm

-- 
A conclusion is the place where you got tired of thinking. 
http://www.pointy-stick.com/blog/


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

Reply via email to