Action
datastore_query_extent(data_dict)
¶
Performs a basic query extent analysis on one resource with parameters and return value compatible with CKAN's datastore.
Just calls vds_basic_extent.
Source code in ckanext/versioned_datastore/logic/basic/action.py
123 124 125 126 127 128 129 130 131 | |
datastore_search(data_dict, resource_id, run_query=True)
¶
Performs a basic query on one resource with parameters and return value compatible with CKAN's datastore.
Just calls vds_basic_query.
Source code in ckanext/versioned_datastore/logic/basic/action.py
17 18 19 20 21 22 23 24 25 26 27 28 29 | |
vds_basic_autocomplete(data_dict, field, term)
¶
Provides autocomplete for values on the given field in the given resource under the given query and version restrictions. Use after and limit to paginate through results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
the data dict passed to this action |
required |
field
|
str
|
the field to autocomplete values on |
required |
term
|
str
|
a prefix to filter field values by |
required |
Returns:
| Type | Description |
|---|---|
|
a dict containing the values and optionally an after key for pagination |
Source code in ckanext/versioned_datastore/logic/basic/action.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
vds_basic_count(data_dict)
¶
Counts the number of records that meet the given query on the resource with the given ID and returns this number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
the data dict passed to this action |
required |
Returns:
| Type | Description |
|---|---|
|
an integer >= 0 |
Source code in ckanext/versioned_datastore/logic/basic/action.py
62 63 64 65 66 67 68 69 70 71 72 73 74 | |
vds_basic_extent(data_dict)
¶
Calculates the geographic extent of the given resource using the given query. Returns a dict containing the overall number of records which matched the query, the number of records with geo data that matched the query and then the bounds as a pair of coordinates (top left, bottom right).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
the data dict passed to this action |
required |
Returns:
| Type | Description |
|---|---|
|
a dict |
Source code in ckanext/versioned_datastore/logic/basic/action.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
vds_basic_query(data_dict, resource_id, run_query=True)
¶
Performs a basic query on one resource using a simple query language which is in line with CKAN's default datastore extension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dict
|
dict
|
the data dict passed to this action |
required |
resource_id
|
str
|
the ID of the resource to search |
required |
run_query
|
Optional[bool]
|
whether to run the query, or just return information about what would have been run |
True
|
Returns:
| Type | Description |
|---|---|
|
a dict |
Source code in ckanext/versioned_datastore/logic/basic/action.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |