Re: could RelatedField sublcass Field?

2008-12-11 Thread SliceOf314
Thank you for the quick feedback! I like the mixin analogy. --~--~-~--~~~---~--~~ 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 unsubsc

could RelatedField sublcass Field?

2008-12-11 Thread SliceOf314
I was just wondering why fields.RelatedField doesn't subclass models.Field? The comment for RelatedField is that it's a hack, and from what I can see RelatedField doesn't override any of Field's functionatliy. This way, fields.ManyToMany and fields.ForeignKey wouldn't have to use multiple inheri

Re: suggestion for ticket #8618, Many-to-many intermediary with multiple foreign keys

2008-10-05 Thread SliceOf314
> 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. --~--~-~--~~~---~--~---

Re: suggestion for ticket #8618, Many-to-many intermediary with multiple foreign keys

2008-10-05 Thread SliceOf314
> 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.

suggestion for ticket #8618, Many-to-many intermediary with multiple foreign keys

2008-10-04 Thread SliceOf314
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