def _fields_to_fields (fields):
  """Helper function to transform a list of possibly 2-tuple field
  tuples into 3-tuples
  """
  _fields = []
  for field in fields:
    if len (field) < 3:
      _fields.append (tuple (field) + (None,))
    else:
      _fields.append (tuple (field))
  return _fields