Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Review and revise the process of saving info when deleting a gloss or media. #659

Open vanlummelhuizen opened 4 years ago

vanlummelhuizen commented 4 years ago

The code below may need some revision because of the use of LemmaIDGlossTranslation and AnnotationIDGlossTranslation.

https://github.com/Signbank/Global-signbank/blob/853bc4f736b2143097109b0414461c1da12e0461/signbank/dictionary/models.py#L1788-L1810

susanodd commented 3 years ago

@vanlummelhuizen are you working on this issue? If not, I will work on it.

This one is also related to #440. That has evolved into Other media paths and filenames.

vanlummelhuizen commented 3 years ago

@susanodd I am not working on this issue so please do. I think the main thing is that idgloss and annotation_idgloss have a many-to-one relationship with Gloss while the code above only takes a default one.

susanodd commented 3 years ago

@vanlummelhuizen I want to add other media to the DeletedGlossOrMedia history. If I expand the choices https://github.com/Signbank/Global-signbank/blob/d218da656e6a7d02dd547a227efc6f4c90c637aa/signbank/dictionary/models.py#L1881 do I need to add a migration? In the past, the choice lists have been disposed of in the generated migrations.

susanodd commented 3 years ago

Hmmm. What is the intention of the DeletedGlossOrMedia history? It would seem the Dataset would also be useful (to store in a history object)? The code that creates objects of this model is: https://github.com/Signbank/Global-signbank/blob/d218da656e6a7d02dd547a227efc6f4c90c637aa/signbank/dictionary/views.py#L2145 https://github.com/Signbank/Global-signbank/blob/d218da656e6a7d02dd547a227efc6f4c90c637aa/signbank/dictionary/models.py#L1871 https://github.com/Signbank/Global-signbank/blob/d218da656e6a7d02dd547a227efc6f4c90c637aa/signbank/video/views.py#L71

But the actual image or gloss gets deleted. The video gets copied to a .bak file or overwritten.

A deleted gloss cannot be restored from a DeletedGlossOrMedia object. There is no information about phonology, etc. It would need to be restored using a backup database or an exported csv as well.

vanlummelhuizen commented 3 years ago

do I need to add a migration?

@susanodd Yes, I believe changing the choices argument in a model field entails making a new migration. @Woseseltops and I decide to hold of new migrations until the whole FieldChoice revision is merged with master. So, if possible, do not make any migrations.

A deleted gloss cannot be restored from a DeletedGlossOrMedia object. There is no information about phonology, etc. It would need to be restored using a backup database or an exported csv as well.

I believe that DeletedGlossOrMedia is not meant for undoing deletion, but just for having some info about what was deleted. Perhaps @ocrasborn can say something about this?

susanodd commented 8 months ago

This issue hasn't been worked on for ages.

I implemented a first go at #127.

susanodd commented 8 months ago

I added an admin class DeletedGlossOrMediaAdmin to be able to browse things that have been deleted. The three options gloss, image, and video are all present. The annotations seem to be okay.

susanodd commented 6 months ago

@vanlummelhuizen there is a class GlossVideoHistory that gets data filled into it, but is not used any place else in the code.