Re: Explicit Relationships

2007-09-19 Thread Marty Alchin
On 9/19/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > class Membership(models.Model): > def add(self, user, guild): > if user.guild_set.count() > 3: > raise Exception, "Maximum guild membership has been reached." > super(Membership, self).add(user, guild) Pardon th

Re: Explicit Relationships

2007-09-19 Thread Marty Alchin
On 9/19/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > It sounds like you're talking about making the m2m table a 3 foreign > key affair (with the third foreign key referencing the intermediate > data) rather than just adding 2 foreign keys (from and to) to the > intermediate model. I'd be i

Re: Explicit Relationships

2007-09-18 Thread Russell Keith-Magee
On 9/19/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > > I think I can make signals work well, if the signal provides a few > arguments. I'm think that if it sent "sender" (the Relationship), > "origin" and "related" (the two models), people should be able to > register functions to do just about a

Re: Explicit Relationships

2007-09-18 Thread Marty Alchin
On 9/18/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > First off - I acknowledge the underlying problem (making m2m > intermediate models easier to use), and I would like to see a > solution. However, while I'm sure your propsed solution could be made > to work, I'm not sure it would be a go

Re: Explicit Relationships

2007-09-17 Thread Russell Keith-Magee
On 9/18/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > > The more I read about what people want out of M2M fields, the more I > think we need to define relationships as a separate high-level > structure. I'm thinking of adding a Relationship class to the mix, > which would be subclassed much like t

Re: Explicit Relationships

2007-09-17 Thread Vsevolod Solovyov
On 9/17/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > This would allow custom values for db_table > (currently impossible for standard M2M) ManyToManyField takes db_table as argument. Description: The name of the table to create for storing the many-to-many data. If this is not provided,

Re: Explicit Relationships

2007-09-17 Thread Marty Alchin
On 9/17/07, Vsevolod Solovyov <[EMAIL PROTECTED]> wrote: > > This would allow custom values for db_table > > (currently impossible for standard M2M) > ManyToManyField takes db_table as argument. Description: > > The name of the table to create for storing the many-to-many data. > If this is no

Explicit Relationships

2007-09-17 Thread Marty Alchin
I was hoping to bring up some ManyToMany enhancements at the sprint, but I didn't manage to participate after all, so they went unvoiced. Instead, I'll bring up some thoughts here and see what you guys think. I apologize in advance for the length of this post, but if you're interested in seeing M2