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
 
Tai Lee  
View profile  
 More options Sep 11 2007, 7:29 pm
From: Tai Lee <real.hu...@mrmachine.net>
Date: Tue, 11 Sep 2007 16:29:09 -0700
Local: Tues, Sep 11 2007 7:29 pm
Subject: Re: Many-to-many relationships with additional columns
I think I'd like to see this functionality in trunk, too. Previously
when I needed a M2M model with sequence or other data, I just created
the M2M model explicitly with ForeignKey fields to the two related
models.

    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)

    class ActorFilmRole(models.Model):
        actor = models.ForeignKey(Actor)
        film = models.ForeignKey(Film)
        role = models.ForeignKey(Role)
        sequence = models.IntegerField()

This seems to work, but is it missing out on some of the niceties /
helper methods of the proposed M2M? What would be the benefits of the
suggested new method over this?


 
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.