GrafeasGroup / blossom

The website. The app. The everything.
6 stars 3 forks source link

Add field for completed transcription in `Submission` serialization #356

Open TimJentzsch opened 2 years ago

TimJentzsch commented 2 years ago

A common use case is to fetch a transcription corresponding to a given submission. However, the transcription_set can contain multiple transcriptions, often an additional transcription by the OCR bot.

So, in order to fetch the transcription by the author who completed the submission, we have two options:

The problem of these approaches is that we can't efficiently batch our calls by ID. In the future, we could add an endpoint to fetch every transcription from a list of IDs. This would be very useful if we want to obtain the transcriptions of a large number of submissions (useful for Buttercup or utility scripts). The current system would make this quite difficult.

I propose that we add an additional field to Submission, which contains the transcription by the author who completed it. It could be computed property that is added by the serializer.

This would add a small overhead to the serialization, but potentially save a lot of API calls, which I'd consider as a big win.