Skip to content

Merge not working with polymorphic models #228

Open
@haessar

Description

@haessar

The adminactions.utils.clone_instance function attempts to instantiate a new object from a given instance, for use in the merge_preview template. Django Polymorphic models contain a "*_ptr" field which refers to the parent object, and when that is passed as a fieldname in clone_instance, the following error is thrown by Django models base.py
AttributeError: can't set attribute

From what I can see, the need to clone this original instance is for fairly superfluous reasons (i.e. just to display the object's "name" field in the template), so can there be a more simplified way of achieving this rather than cloning the entire instance?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions