d1_gmn.app.views package

Submodules

d1_gmn.app.views.assert_db module

Asserts used in views.

These directly return a DataONE Exception to the client if a test condition is not true.

d1_gmn.app.views.assert_db.is_valid_pid_for_create(did)

Assert that did can be used as a PID for creating a new object with MNStorage.create() or MNStorage.update().

d1_gmn.app.views.assert_db.is_valid_pid_to_be_updated(did)

Assert that did is the PID of an object that can be updated (obsoleted) with MNStorage.update()

d1_gmn.app.views.assert_db.is_did(did)
d1_gmn.app.views.assert_db.is_existing_object(did)
d1_gmn.app.views.assert_db.is_sid(did)
d1_gmn.app.views.assert_db.is_bool_param(param_name, bool_val)
d1_gmn.app.views.assert_db.is_in_revision_chain(pid)
d1_gmn.app.views.assert_db.is_not_obsoleted(pid)
d1_gmn.app.views.assert_db.post_has_mime_parts(request, parts)

Validate that a MMP POST contains all required sections.

Parameters
  • request – Django Request

  • parts – [(part_type, part_name), …]

Returns

None or raises exception.

Where information is stored in the request: part_type header: request.META[‘HTTP_<UPPER CASE NAME>’] part_type file: request.FILES[‘<name>’] part_type field: request.POST[‘<name>’]

d1_gmn.app.views.assert_db.date_is_utc(date_time)
d1_gmn.app.views.assert_db.url_is_http_or_https(url)
d1_gmn.app.views.assert_db.url_is_retrievable(url)
d1_gmn.app.views.assert_db.is_not_replica(pid)
d1_gmn.app.views.assert_db.is_not_archived(pid)

d1_gmn.app.views.assert_sysmeta module

Asserts used in views.

These directly return a DataONE Exception to the client if a test condition is not true.

d1_gmn.app.views.assert_sysmeta.sanity(request, sysmeta_pyxb)

Check that sysmeta_pyxb is suitable for creating a new object and matches the uploaded sciobj bytes.

d1_gmn.app.views.assert_sysmeta.matches_url_pid(sysmeta_pyxb, url_pid)
d1_gmn.app.views.assert_sysmeta.has_matching_modified_timestamp(new_sysmeta_pyxb)
d1_gmn.app.views.assert_sysmeta.obsoletes_not_specified(sysmeta_pyxb)
d1_gmn.app.views.assert_sysmeta.obsoletes_matches_pid_if_specified(sysmeta_pyxb, old_pid)
d1_gmn.app.views.assert_sysmeta.is_valid_sid_for_new_standalone(sysmeta_pyxb)

Assert that any SID in sysmeta_pyxb can be assigned to a new standalone object.

d1_gmn.app.views.assert_sysmeta.is_valid_sid_for_chain(pid, sid)

Assert that sid can be assigned to the single object pid or to the chain to which pid belongs.

  • If the chain does not have a SID, the new SID must be previously unused.

  • If the chain already has a SID, the new SID must match the existing SID.

d1_gmn.app.views.assert_sysmeta.calculate_checksum(request, checksum_calculator)

d1_gmn.app.views.create module

d1_gmn.app.views.decorators module

d1_gmn.app.views.external module

d1_gmn.app.views.get_package module

d1_gmn.app.views.gmn module

d1_gmn.app.views.headers module

d1_gmn.app.views.internal module

d1_gmn.app.views.slice module

Handle slicing / paging of multi-page result set.

d1_gmn.app.views.slice.add_slice_filter(request, query, total_int)
d1_gmn.app.views.slice.cache_add_last_in_slice(request, query, start_int, total_int, sort_field_list)

d1_gmn.app.views.util module