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

Delete object from model #184

Open
abd-Hirz opened this issue Jan 7, 2021 · 4 comments
Open

Delete object from model #184

abd-Hirz opened this issue Jan 7, 2021 · 4 comments

Comments

@abd-Hirz
Copy link

abd-Hirz commented Jan 7, 2021

I succeseed to deploy django-river in my project, but I have minor issue which I can not delete any created one which get approval thru the workflow. I'm always getting this message when ever try to delete object from the admin page.
Deleting the object xxxx would require deleting the following protected related objects:

Transition Approval: TransitionApproval object (1)

I believe the issue within TransitionApproval table which I believe it's PROTECTED and can not be cascaded to be deleted.
image

@abd-Hirz
Copy link
Author

abd-Hirz commented Jan 7, 2021

I figure out the problem and solve the issue, would you please let me know if you agree with what I did:
I open the source code of django-river : river -> models -> transitionapproval.py

I have been changed the transition field attribute from PROTECT -> CASCADE .
so now I can delete any object from my current model.

Is this modification is is correct and will not make side effect to the rest of django-river library.

@javrasya
Copy link
Owner

Sorry for not documenting this bit but that shouldn't result in anything bad on the django-river side. Delete the transition approval objects of your object first before you delete it as you figured.

@DanielAron
Copy link

@javrasya , sorry for this dummy question but,
how can I delete the transition approval from an object id?

@abd-Hirz
Copy link
Author

@DanielAron Currently this feature are not available in django-river. what I'm doing is adjust the source code and delete the object from my localhost.

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

No branches or pull requests

3 participants