Given the example code in the ticket:

from django.db import models

class Person(models.Model):
    name = models.CharField(max_length=100)
    vacations = models.ManyToManyField('Location', through='Vacation',
blank=True)


class Location(models.Model):
    city = models.CharField(max_length=100)
    country = models.CharField(max_length=100)

class Vacation(models.Model):
    person = models.ForeignKey(Person)
    location = models.ForeignKey(Location)
    date = models.DateField()
    travel_agent = models.ForeignKey(Person,
related_name='booked_vacations')


How does the following syntax sound?

If people like it, or have better suggestions, I could write the
patch.

vacations = models.ManyToManyField('Location', through=('person,
'Vacation','location'), blank=True)

This should give enough information to specify the exact attribute
path for the m2m relationship.  If the intermediary table doesn't have
multiple keys, then the existing syntax should suffice.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to