On Sat, Sep 20, 2008 at 8:37 AM, Nate Thelen <[EMAIL PROTECTED]> wrote:
>
> Looking at the docs here:
>
> http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships
>
> I cannot find any reference to how to access the data in the
> "Membership" table. For example, if I have a reference to the
> "beatles" object, how do I find the "date_joined" for each of the
> "Person" objects. I have looked through the other sections of the
> documentation, searched this group, and searched via Google, but
> couldn't find the info.
Short version: You access the membership table using the foreign key
relationship that the membership defines.
Long version: Your question ("the date_joined for each person object")
is actually ill posed - a person doesn't have a date_joined without a
group to also give context. "The date person X joined group Y" can be
answered as:
>>> Membership.objects.get(person=X, group=y).date_joined
It might help to think about it like this - m2m-intermediate tables
don't add extra data to an m2m relation, they make a 2-step foreign
key relation behave like an m2m relation.
Yours,
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---