def _FormatAttribute(self, name, value):
    """Returns the attribute value; If none, returns '-'. Formats by
    default the following fields: 'viewpoint_id', 'episode_id',
    'photo_id', 'timestamp', 'Location', 'Placemark'.
    """
    if name == 'viewpoint_id' or name == 'private_vp_id':
      did, (vid, sid) = Viewpoint.DeconstructViewpointId(value)
      pretty = '%s/%d/%d' % (value, did, vid)
      return FmtDefault._ViewpointLink(value, pretty)
    elif name == 'user_id' or name == 'sender_id':
      return self._UserLink(value)
    elif name == 'episode_id' or name == 'parent_ep_id':
      ts, did, (eid, sid) = Episode.DeconstructEpisodeId(value)
      pretty = '%s/%d/%d' % (value, did, eid)
      return self._EpisodeLink(value, pretty)
    elif name == 'photo_id' or name == 'parent_id':
      ts, did, (pid, sid) = Photo.DeconstructPhotoId(value)
      pretty = '%s/%d/%d' % (value, did, pid)
      return self._PhotoLink(value, pretty)
    elif name == 'timestamp' or name == 'last_updated' or name == 'expires' or name == 'last_fetch':
      return self._FormatTimestamp(value)
    elif name == 'location':
      return self._XEscape(', '.join(['%s: %s' % (k, v) for k, v in UnpackLocation(value)._asdict().items()]))
    elif name == 'placemark':
      return self._XEscape(', '.join(['%s: %s' % (k, v) for k, v in UnpackPlacemark(value)._asdict().items()]))
    else:
      return self._XEscape('%s' % value)
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/admin/formatters.py/FmtDefault._FormatAttribute/original