Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Many-to-many relationships with additional columns
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jacob Kaplan-Moss  
View profile  
 More options May 31 2007, 4:55 pm
From: "Jacob Kaplan-Moss" <jacob.kaplanm...@gmail.com>
Date: Thu, 31 May 2007 15:55:55 -0500
Local: Thurs, May 31 2007 4:55 pm
Subject: Re: Many-to-many relationships with additional columns
On 5/31/07, Marty Alchin <gulop...@gamemusic.org> wrote:

+1.

No, wait, + a whole lot more than that! I've been wanting explicit M2M
join objects for quite some time; this is a pretty neat way to
accomplish it.

Just for shits and giggles, here's another possible syntax I'd been
considering::

    class Role(models.Model):
        role = models.CharField(maxlength=255)

    class Film(models.Model):
        title = models.CharField(maxlength=255)

    class Actor(models.Model):
        name = models.CharField(maxlength=255)
        films = models.ManyToManyField(Film, through=Role,
related_name="actors")

(i.e. Actor relates to File "through" Role.)

Jacob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.