* owner: elektrrrus =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:36>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Sergey Fedoseev (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:37>
* cc: kamandol (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:38>
* cc: Carlos Palol (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:39>
* cc: mrodal (added)
Comment:
wow, 11 years.. and it seems so simple to be able to insert a row with 1
FK and the child fields..
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:40>
* cc: Bel-Shazzar (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:41>
* cc: InvalidInterrupt (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:42>
* cc: Sergey Fedoseev (removed)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:43>
* cc: JM Barbier (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:44>
* cc: Charlie Denton (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:45>
Comment (by Charlie Denton):
I'm in the process of refactoring some code to remove use of multi-table
inheritance, and the ability to create these tables separately would be
very useful to me as a part of the refactor.
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:46>
Comment (by Simon Charette):
I wonder if the newly introduced `force_insert` feature in Django 5.0 (not
released yet) that allows specifying which tables should be inserted
happens to address this issue see (#30382 and
a40b0103bccb8216c944188d329d8ea5eceb7e92).
To take the initially reported use case
{{{#!python
parent = Restaurant.objects.get(name__iexact="Bob's Place").parent
bar = Bar(parent=parent, happy_hour=True)
bar.save(force_insert=(Bar,))
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:47>
Comment (by HAMA Barhamou):
if this method worked:
{{{
extended_user = ExtendedUser(user_ptr_id=auth_user.pk)
extended_user.__dict__.update(auth_user.__dict__)
extended_user.save()
}}}
here: [https://stackoverflow.com/questions/4064808/django-model-
inheritance-create-sub-instance-of-existing-instance-downcast]
why not simply use it under the hood of django. Too easy. there must be
something I've missed. **I wonder what it is. do you have an idea?** or
maybe it's not enough to cover all scenarios.
--
Ticket URL: <https://code.djangoproject.com/ticket/7623#comment:48>