docs: def list_calculations(db, job_type, user_name):
      """
      Yield a summary of past calculations.
  
      :param db: a :class:`openquake.server.dbapi.Db` instance
      :param job_type: 'hazard' or 'risk'
      :param user_name: an user name
      """
      jobs = db('SELECT *, %s FROM job WHERE user_name=?x '
                'AND job_type=?x ORDER BY start_time' % JOB_TYPE,
                user_name, job_type)
      out = []
      if len(jobs) == 0:
          out.append('None')
      else:
          out.append('job_id |     status |          start_time | '
                     '        description')
          for job in jobs:
              descr = job.description
              start_time = job.start_time
              out.append('%6d | %10s | %s | %s' % (
                  job.id, job.status, start_time, descr))
      return out