Re: Stuck on generic relations

2007-10-11 Thread Doug B
Anwering my own question... it helps to specify an actual join condition. This worked: extra['last_event_when'] = "SELECT event_loggedevent.when FROM event_loggedevent,event_eventrelation WHERE (event_eventrelation.event_id = event_loggedevent.id) AND (event_eventrelation.content_type_id = %s) AN

Stuck on generic relations

2007-10-11 Thread Doug B
I have a page that needs to display basic user information plus the last logged activity date for the user, and I need to be able to sort by that value. (there are two of these relations,I'm just mentioning one here) My SQL-fu is very, very weak and I just can't seem to get it. There is a table