USGS-WiM / stnservices-django

Other
0 stars 0 forks source link

Write Cascade Delete for Site deletion #1

Open lprivette opened 2 years ago

lprivette commented 2 years ago

Would like to have a larger discussion before deciding to do this or not.

Currently you need to manually delete all entities associated with a site (which may or may not span data for many different events at the same site)

The worry is we're creating a lot of work for an admin to delete a site. It can also get confusing if an admin is trying to delete a site that appears empty (event selected), but they get the error that associated entities exist (there is data for a different event). There may be other ways to mitigate the confusion that would avoid a cascade delete. needs discussion. Maybe worth asking Athena how often she is deleting sites.

aaronstephenson commented 2 years ago

Just a quick note to say that Cascade Delete is a configuration option in Django models called on_delete (with several other choices, too).