Open vanlummelhuizen opened 4 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.
@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.
@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.
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.
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?
This issue hasn't been worked on for ages.
I implemented a first go at #127.
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.
@vanlummelhuizen there is a class GlossVideoHistory
that gets data filled into it, but is not used any place else in the code.
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