Hi Amir,

On Jun 15, 2013, at 9:11 AM, Amir Rachum <[email protected]> wrote:
> I'm not sure if this feature was discussed before (I've seen some mentions of 
> it when searching this group, but nothing definitive).
> I have written a blog post regarding the reasons (and the suggested syntax) 
> to use this relationship, and would love some feedback
> 
> http://blog.amir.rachum.com/post/53019452363/a-case-for-a-onetomany-relationship-in-django

The strongest reason not to do this is that it breaks the correspondence 
between model fields and database columns. If you added a new OneToMany field 
on Band pointing to Musician, suddenly the (unmodified) Musician model's db 
table would require a schema migration, while the Band table would remain 
unchanged. (Yes, ManyToManyField already sort of breaks this correspondence, 
but only in that it causes a new table to be created in the same app where you 
added the field. It never requires a schema migration for an untouched model 
class, possibly in a different app, which is much worse.)

I think this downside alone is enough to kill the proposal for Django core, 
especially considering the rationale in favor isn't that strong; it's just a 
new way to spell the exact equivalent of a ForeignKey.

That said, I'm pretty sure you could code this up outside of core, if you'd 
like to experiment with it.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to