This doesn't answer your question directly, but wouldn't many-to-many
fields help a bit here?

http://www.djangoproject.com/documentation/model-api/#many-to-many-relationships

Sorry if you've already thought about this and dismissed it.

/alex

On Feb 12, 2008 11:41 PM, Gus <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> I have something like:
>
> Class User
>  id
>
> Class Group
>  id
>
> Class Membership
>  id
>  group fk
>  user fk
>  type char1
>
> Class Message
>  id
>  group fk
>  user fk
>
> I'm a little confused about how to do this join from the django db
> api:
>
> select message.* from message, membership
>  where message.group_id = membership.group_id
>  AND message.user_id = membership.user_id
>  AND membership.type <> 'B'
>
> I basically want all the messages where the related membership type is
> not 'B'...
>
> any help would be much appreciated
>
> >
>

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