Hello list, I have question. With this model:
---------------------------------------------------------------------
1) class EE(Persona):
    .....
2) class DD(models.Model):
    ee_id = models.ForeignKey(EE)

3) The User table

4) class PPDD(models.Model):
      user_id = models.ForeignKey(User)
      dd_id = models.ForeignKey(DD)
      .....
--------------------------------------------------------------------

How can I do (without RawSQL) a query like this?:

select distinct EE.* from EE inner join
(
      select DD.* from DD inner join PPDD on (DD.id=PPDD.dd_id and
PPDD.user_id=2)
 ) as my_filter
 on (EE.id=my_filter.ee_id)

I want to get the data in the table EE that's associated to PPDD
through DD. I read the django documentation, but I can't understand
how do the query.

Thanks for read, and sorry for my poor english.

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