def delete_records(resource_type, resource):
    logger.debug('delete_records %s %s', resource_type, resource)
    adapter = OaiAdapter()
    try:
        (resource_id, identifier, datestamp, set_spec, public) = adapter.get_record(resource_type, resource)
    except TypeError:
        raise RuntimeError(('Could not obtain record for %s %s' % (resource_type, resource)))
    for metadata_prefix in adapter.resource_types[resource_type]:
        try:
            record = Record.objects.get(identifier=identifier, metadata_prefix=metadata_prefix)
            record.datestamp = datestamp
            record.set_spec = set_spec
            record.deleted = True
            record.save()
        except Record.DoesNotExist:
            pass
def delete_records(resource_type, resource):
    logger.debug('delete_records %s %s', resource_type, resource)
    adapter = OaiAdapter()
    try:
        (resource_id, identifier, datestamp, set_spec, public) = adapter.get_record(resource_type, resource)
    except TypeError:
        raise RuntimeError(('Could not obtain record for %s %s' % (resource_type, resource)))
    for metadata_prefix in adapter.resource_types[resource_type]:
        try:
            record = Record.objects.get(identifier=identifier, metadata_prefix=metadata_prefix)
            record.datestamp = datestamp
            record.set_spec = set_spec
            record.deleted = True
            record.save()
        except Record.DoesNotExist:
            pass