def _check_read_only(context, resource_id):
 res = p.toolkit.get_action('resource_show')(context, {'id': resource_id})
 if (res.get('url_type') != 'datastore'):
  raise p.toolkit.ValidationError({'read-only': ['Cannot edit read-only resource. Either pass"force=True" or change url-type to "datastore"']})

def _check_read_only ( context , resource_id ) : res = p . toolkit . get_action ( 'resource_show' ) ( context , { 'id' : resource_id } ) if ( res . get ( 'url_type' ) != 'datastore' ) : raise p . toolkit . ValidationError ( { 'read-only' : [ 'Cannot edit read-only resource. Either pass"force=True" or change url-type to "datastore"' ] } )
raises exception if the resource is read-only .