#29871: Resetting primary key for a derived object does not work
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Victor Porton):
Replying to [comment:5 Simon Charette]:
> Hello Victor, could you provide more details about what exactly you are
trying to achieve here?
>
> So far you've only provided a test case that fails. Are you trying to
create a copy of an existing objects using MTI?
Yes. I am trying to create a copy of an existing object using MTI.
> Providing more details about what you are trying to achieve and why
you're expecting the test to pass would help us to determining if this is
actually a bug.
I am trying to create a copy of a `Derived` object which was in the DB
long before. The copy should contain all fields of the `Derived` model and
all fields of its base models.
As for now, I do not know a reliable and not error-prone (such as
depending on usage of base of derived class) way to do this. If there is
no such way, it is a missing feature in Django and this should be
considered at least as a feature suggestion.
In my real code I may have several levels of inheritance (not just `Item`
and `Derived`).
--
Ticket URL: <https://code.djangoproject.com/ticket/29871#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.68ea1d336bf114201014a47568a314b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.