You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name: matches an appropriate element inside of the XForm Element's XML.
This means that if an XML submission contains:
<take_a_picture_of_your_shoes>Screenshot from 2022-03-30 12-12-56-12_13_3.png</take_a_picture_of_your_shoes>
…then the POST data should (eventually, because a single submission can be sent in multiple POSTs) contain a file with the identical name Screenshot from 2022-03-30 12-12-56-12_13_3.png. Great, all's well.
However, this file ends up being stored in the logger.Attachmentmodel, where we and Django (see kobotoolbox/kpi#3659) do some transformations on the file name.
The result is that we do not have a good way to link the response to the take_a_picture_of_your_shoes question (as received in the XML but also stored in JSON), i.e. Screenshot from 2022-03-30 12-12-56-12_13_3.png, to its corresponding Attachment object and the media_file it contains.
We should add a new field on logger.Attachment that stores the verbatim question response. We could also take the opportunity to store the question XPath in the Attachment model as well (what do you think, @dorey?)
The text was updated successfully, but these errors were encountered:
@jnm Or/and what about adding the question name in the _attachments list in Json response too?
jnm
changed the title
wip attachment model needs a field that verbatim matches the xml response
Add field to logger.Attachment that matches question response verbatim
Mar 30, 2022
Hello here... Interested in following up here, since currently using the API to retrieve attachments is ambiguous because of this.
Any idea of a timeline for adding this explicit attachment<>question linkage?
Thx!
From the OpenRosa Form Submission API specification:
This means that if an XML submission contains:
…then the POST data should (eventually, because a single submission can be sent in multiple POSTs) contain a file with the identical name
Screenshot from 2022-03-30 12-12-56-12_13_3.png
. Great, all's well.However, this file ends up being stored in the
logger.Attachment
model, where we and Django (see kobotoolbox/kpi#3659) do some transformations on the file name.The result is that we do not have a good way to link the response to the
take_a_picture_of_your_shoes
question (as received in the XML but also stored in JSON), i.e.Screenshot from 2022-03-30 12-12-56-12_13_3.png
, to its correspondingAttachment
object and themedia_file
it contains.We should add a new field on
logger.Attachment
that stores the verbatim question response. We could also take the opportunity to store the question XPath in theAttachment
model as well (what do you think, @dorey?)The text was updated successfully, but these errors were encountered: