through sounds a little odd to me, as Vacation is the table 'through' which
the m2m is made. Shouldn't it be 'in_between' or something the like here?
(As Vacation is kind of 'in between' Person and Location)
just my 2p.
TiNo
On Mon, Oct 6, 2008 at 2:44 AM, SliceOf314 <[EMAIL PROTECTED]>wrote:
>
On Mon, Oct 6, 2008 at 1:04 AM, SliceOf314
<[EMAIL PROTECTED]> wrote:
>
>> My personal preference for that ticket is that the annotation to say
>> which foreign keys to use should belong on the model for the
>> intermediate table, not adding to the declaration of the connecting
>> models.
>
> That
> For example:
>
> class Vacation(Model):
> ...
> class Meta:
> through = ('person', 'location')
>
> Yours,
> Russ Magee %-)
Sounds good to me. Unless someone else has a better suggestion, I
will go ahead and start work on a patch.
--~--~-~--~~~---~--~---
> My personal preference for that ticket is that the annotation to say
> which foreign keys to use should belong on the model for the
> intermediate table, not adding to the declaration of the connecting
> models.
That is a very fair point. Therefore, how does the following sound?
from django.
On Sat, 2008-10-04 at 10:16 -0700, SliceOf314 wrote:
[...]
> 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 sh
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