javrasya / django-river

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

Deleting the selected flow would require deleting the following protected related objects #161

Open rupin opened 4 years ago

rupin commented 4 years ago

I am trying to delete the entries associated with the model that has the Statefield. I am unable to delete them, because the TransitionalApproval Objects are protected. Please see a video of this in action here.

https://youtu.be/Sin5zWeC0QU

Is this a setting?

My Django River version is django-river==3.2.0

cyberdude86 commented 4 years ago

They are protected objects but I found that you can do a filter for the object_id relating to the state field object and delete all records of TransitionalApprovals model and it will allow you to delete the record

rupin commented 4 years ago

Will this be need to be done from the database by issuing queries? I don't have access to it on my instance.

cyberdude86 commented 4 years ago

I do a direct query and then delete each result in order to allow me to delete the parent

javrasya commented 4 years ago

This is a dangerous operation since you can accidentally delete critical things if it was that easy but the reason those objects are protected is that they might be used by other objects. But it should definitely be documented to at least how to do this manually.

ghost commented 4 years ago

I agree that, even if it's not available directly, it should be documented how to safely do this