On Sat, Jul 10, 2010 at 9:31 AM, Derek <[email protected]> wrote:
> Running Django 1.2.1 under Python 2.6.
> I am obviously missing something cruccial, but I am just not sure where this
> is...
> I have a setup which includes a number of many-to-many models in a legacy
> database.  For example:
>
> class Grouping(models.Model):
>     id = models.AutoField(primary_key=True, db_column='GroupingID')
>     name = models.CharField(max_length=250, db_column='GroupingName',
> unique=True)
> class TaxAgreement(models.Model):
>     id = models.AutoField(primary_key=True, db_column='TaxID')
>     title = models.CharField(max_length=100, db_column='TaxTitle',
> unique=True)
>     groupings = models.ManyToManyField(Grouping,
> db_table='taxagreementgrouping')

Use through keyword
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField.through

groupings = models.ManyToManyField(Grouping, through='TaxAgreementGrouping')

~Rolando

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

Reply via email to