code: def serialize(self, value):
      
      if isinstance(value, list):
        return self.list_sep.join(_helpers.str_or_unicode(x.name) for x in value)
      else:
        return _helpers.str_or_unicode(value.name)
docs: See base class.