On Wed, Jul 10, 2013 at 4:20 PM, Curtis Maloney <[email protected]>wrote:
> I've seen enough people in #django suffering because they need a FKey on a > table they simply can't alter -- be it because it's in a 3rd party app, or > simply a table their DBA won't permit them to alter, or what have you. > > In the end they wind up having to create the equivalent of a m2m through > table, but with one side being a 1to1. > > ISTM that the sugar to make this behave wouldn't be much greater than that > used for MTI, but I say that having not delved yet, so... what would I > know? :) > This is a use case I've seen many times in the past -- most commonly with the User model, but with others as well. To that end, I have a certain sympathy for the request. I'm not sure I completely agree with Carl that is breaks correspondence -- after all, m2m fields don't correlate to a field, either. However, in the absence of a built-in migrations framework, I suspect a O2M field would be a pretty efficient foot-gun for newcomers. That said - I agree that it should be possible to implement this external to core. There's a certain amount of "here be dragons" in the django.db.models.fields.related code, but it should be relatively straightforward to implement the reverse of a ForeignKey. If someone is interested in this, I'd rather see it proven as an external tool before we add it to core. Yours, Russ Magee %-) -- 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.
