code: def _ws_data(self, ws):
          
          data = {
              'obj': ws,
              'id': ws.id,
              'url': ws.absolute_url(),
              'template_title': ws.getWorksheetTemplateTitle(),
              'remarks': ws.getRemarks(),
              'date_printed': self.ulocalized_time(DateTime(), long_format=1),
              'date_created': self.ulocalized_time(ws.created(), long_format=1),
          }
  
          # Sub-objects
          data['ars'] = self._analyses_data(ws)
          data['createdby'] = self._createdby_data(ws)
          data['analyst'] = self._analyst_data(ws)
          data['printedby'] = self._printedby_data(ws)
  
          # Unify the analyses titles for the template
          # N.B. The Analyses come in sorted, so don't use a set() to unify them,
          #      because it sorts the Analyses alphabetically
          ans = []
          for ar in data['ars']:
              for an in ar['analyses']:
                  title = an["title"]
                  if title in ans:
                      continue
                  ans.append(title)
          data['analyses_titles'] = ans
  
          portal = self.context.portal_url.getPortalObject()
          data['portal'] = {'obj': portal,
                            'url': portal.absolute_url()}
          data['laboratory'] = self._lab_data()
  
          return data
docs: Creates an ws dict, accessible from the view and from each
              specific template.
              Keys: obj, id, url, template_title, remarks, date_printed,
                  ars, createdby, analyst, printedby, analyses_titles,
                  portal, laboratory