Id as url
IdAsUrlTransform
¶
Bases: BaseTransform
Source code in ckanext/versioned_datastore/lib/downloads/transforms/id_as_url.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
__call__(data)
¶
Reformat an ID field as a URL (probably one that links to that record). Requires an endpoint (config option ckanext.versioned_datastore.record_view_endpoint, default 'object.view') taking the ID field as the 'uuid' named argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
the record data to be transformed |
required |
Returns:
| Type | Description |
|---|---|
|
the transformed data (or untransformed if there was an error). |
Source code in ckanext/versioned_datastore/lib/downloads/transforms/id_as_url.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
__init__(field=None, **kwargs)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
the name of the data field that contains the ID and that will contain the URL |
None
|
Source code in ckanext/versioned_datastore/lib/downloads/transforms/id_as_url.py
17 18 19 20 21 22 | |