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 is a very fair point.  Therefore, how does the following sound?
>
> class Vacation(models.Model):
>    # my suggestion
>    person = models.ForeignKey(Person, from_m2m='vacations')
>    location = models.ForeignKey(Location)
>    date = models.DateField()
>    travel_agent = models.ForeignKey(Person,
> related_name='booked_vacations')

I would be inclined to put the setting in the Meta block. Under your
proposal, the setting is tied to the key, but the setting isn't really
controlling the behaviour of the key - it's controlling the way the
model as a whole is interpreted. Having the setting on the key would
mean it is exposed on every foreign key - not just the ones in M2M
tables.

For example:

class Vacation(Model):
   ...
   class Meta:
      through = ('person', 'location')

Yours,
Russ Magee %-)

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