* status: new => closed
* resolution: => wontfix
* type: Cleanup/optimization => New feature
* component: Uncategorized => Database layer (models, ORM)
Comment:
As far as I'm aware, using `extra()` is the right thing to do in your
case. You could also try to change `ModelB.c` to a `ForeignKey` without a
database constraint, e.g.
{{{
c = models.ForeignKey(ModelC, ..., db_constraint=False)
}}}
but it's a bad idea in most of cases (see
[https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.ForeignKey.db_constraint
docs]).
Even if it's feasible I don't think there would be consensus to add that
complexity to Django itself. You can raise the idea on the
DevelopersMailingList to reach a wider audience and see what other think
(see also [https://docs.djangoproject.com/en/stable/internals/contributing
/bugs-and-features/#requesting-features the guidelines with regards to
requesting features]).
--
Ticket URL: <https://code.djangoproject.com/ticket/33999#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.