Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Pass origin object to signals #876

Open
2 tasks done
dacotagh opened this issue Apr 3, 2024 · 1 comment
Open
2 tasks done

[Feature] Pass origin object to signals #876

dacotagh opened this issue Apr 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dacotagh
Copy link

dacotagh commented Apr 3, 2024

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

Some copied objects have links to data out of the data base, linked by id or uuid.
When object cloned, it has new id/uuid.
To copy external data user need access to origin id/uuid of object.

Describe the solution you'd like?

I suppose to add origin parameter to pre_clone_save/post_clone_save signals.

To do this, in function make_clone in mixin.py we need to make these changes:

    -pre_clone_save.send(sender=self.__class__, instance=duplicate)
    +pre_clone_save.send(sender=self.__class__, instance=duplicate, origin=self)

...

    -post_clone_save.send(sender=self.__class__, instance=duplicate)
    +post_clone_save.send(sender=self.__class__, instance=duplicate, origin=self)

Describe alternatives you've considered?

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dacotagh dacotagh added the enhancement New feature or request label Apr 3, 2024
Copy link
Contributor

github-actions bot commented Apr 3, 2024

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant