code: def register_mapper(self, mapper, content_type, shortname=None):
          
  
          self._check_mapper(mapper)
          cont_type_names = self._get_content_type_names(content_type, shortname)
          self._datamappers.update(dict([(name, mapper) for name in cont_type_names]))
docs: Register new mapper.
  
          :param mapper: mapper object needs to implement ``parse()`` and
          ``format()`` functions.