javrasya / django-river

Django workflow library that supports on the fly changes ⛵
BSD 3-Clause "New" or "Revised" License
742 stars 105 forks source link

Delete object from model #184

Open abd-Hirz opened 3 years ago

abd-Hirz commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

abd-Hirz commented 2 years ago

@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.