code: def get_attachments(self):
          
  
          attachments = []
  
          # process AR attachments
          for attachment in self.context.getAttachment():
              attachment_info = self.get_attachment_info(attachment)
              attachments.append(attachment_info)
  
          # process analyses attachments
          for analysis in self.context.getAnalyses(full_objects=True):
              for attachment in analysis.getAttachment():
                  attachment_info = self.get_attachment_info(attachment)
                  attachment_info["analysis"] = analysis.Title()
                  attachment_info["analysis_uid"] = api.get_uid(analysis)
                  attachments.append(attachment_info)
  
          return attachments
docs: Returns a list of attachments info dictionaries
  
          Original code taken from bika.lims.analysisrequest.view