code: def save_header_data(self):
          
          client = self.aq_parent
  
          headers = self.get_header_values()
          if not headers:
              return False
  
          # Plain header fields that can be set into plain schema fields:
          for h, f in [
              ('File name', 'Filename'),
              ('No of Samples', 'NrSamples'),
              ('Client name', 'ClientName'),
              ('Client ID', 'ClientID'),
              ('Client Order Number', 'ClientOrderNumber'),
              ('Client Reference', 'ClientReference')
          ]:
              v = headers.get(h, None)
              if v:
                  field = self.schema[f]
                  field.set(self, v)
              del (headers[h])
  
          # Primary Contact
          v = headers.get('Contact', None)
          contacts = [x for x in client.objectValues('Contact')]
          contact = [c for c in contacts if c.Title() == v]
          if contact:
              self.schema['Contact'].set(self, contact)
          else:
              self.error("Specified contact '%s' does not exist; using '%s'"%
                         (v, contacts[0].Title()))
              self.schema['Contact'].set(self, contacts[0])
          del (headers['Contact'])
  
          # CCContacts
          field_value = {
              'CCNamesReport': '',
              'CCEmailsReport': '',
              'CCNamesInvoice': '',
              'CCEmailsInvoice': ''
          }
          for h, f in [
              # csv header name      DataGrid Column ID
              ('CC Names - Report', 'CCNamesReport'),
              ('CC Emails - Report', 'CCEmailsReport'),
              ('CC Names - Invoice', 'CCNamesInvoice'),
              ('CC Emails - Invoice', 'CCEmailsInvoice'),
          ]:
              if h in headers:
                  values = [x.strip() for x in headers.get(h, '').split(",")]
                  field_value[f] = values if values else ''
                  del (headers[h])
          self.schema['CCContacts'].set(self, [field_value])
  
          if headers:
              unexpected = ','.join(headers.keys())
              self.error("Unexpected header fields: %s" % unexpected)
docs: Save values from the file's header row into their schema fields.