I’m trying to submit results using the api, using the methods I found here:
Here’s my test code:
ws_obj = api.get_object_by_uid(worksheet)
layout = ws_obj.Layout
result = 1.69
for position in layout:
sample = api.get_object_by_uid(position['container_uid'])
sample_id = api.get_id(sample)
analysis = api.get_object_by_uid(position['analysis_uid'])
result = result + 0.23
analysis.setResult(result)
print(sample_id + " " + analysis.Title() + " = " + str(result))
print(analysis.Result)
The output I get from my last line always matches the result I submit, but when I navigate to the AnalysisRequest or Worksheet the results are still blank. What do?
I may be wrong, but I think senaite.api was deprecated and therefore archived.
You can either use the (new?) SENAITE API (you will find examples in its doctests) or you can use SENAITE JSON API (documentation here), depending on what you want to achieve.