action_2.py 582 B

1234567891011121314151617
  1. def archiver_dataset_show(context, data_dict=None):
  2. '''Return a details of the archival of a dataset, aggregated across its
  3. resources.
  4. :param id: the name or id of the dataset
  5. :type id: string
  6. :rtype: dictionary
  7. '''
  8. id_ = _get_or_bust(data_dict, 'id')
  9. dataset = model.Package.get(id_)
  10. if not dataset:
  11. raise ObjectNotFound
  12. archivals = Archival.get_for_package(dataset.id)
  13. archival_dict = aggregate_archivals_for_a_dataset(archivals)
  14. p.toolkit.check_access('archiver_dataset_show', context, data_dict)
  15. return archival_dict