Open uklomp opened 1 month ago
Maybe related to this?
Q: @Jetske I'm working on #1303 and finally have it showing a list. But this took some time.
It seems the data stored in the model AnnotatedGloss
, the field stored in "gloss
" is actually an ID, not a foreign key.
So an additional lookup is needed to actually retrieve the Gloss
object using this ID.
(Normally, if you retrieve the value in a foreign key field it should be an object.)
This method doesn't work:
Inside my loop, I have both the annotated gloss (variable this
) and the gloss object (this_gloss
), and the following:
this = AnnotatedGloss.objects.get(id=annotatedgloss_id)
this_gloss = Gloss.objects.get(id=this.gloss_id)
......
print(this.annotatedsentence)
print(this.show_annotationidglosstranslation())
print(this_gloss.annotationidglosstranslation_set.all())
where "this" is an annotated gloss and "this_gloss" is the gloss. The second print does not output anything, but the first and third do.
@uklomp That is strange because indeed those glosses are given in the list when uploading the file. I'll fix it asap.
@susanodd that's not directly related so let's discuss in another issue.
Found the problem. The annotations are sent to the form as "ann1:ann2:ann3;" and when adding them split by ":" so this obviously fails if the gloss contains a ":". I changed it to json format, that should be more robust.
Sorry, this fix was done in the manage sentences branch, so it will be merged hopefully soon when we complete #1314
The manage annotated sentences is available under the Datasets menu on signbank.
Hi @Jetske, I thought you were already working on this but I'm not sure anymore so I also made an issue. In this annotated sentence https://signbank.cls.ru.nl/dictionary/gloss/44092 - the pointing sign is glossed twice and should appear in the annotations but is not there. It concerns glosses like PT-1hand:1