Action
vds_slug_create(resource_ids=None, version=None, query=None, query_version=None, pretty_slug=True, nav_slug=False)
¶
Creates a slug for the given query options. If the slug already exists then this will be indicated in the is_new key of the response dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_ids
|
List[str]
|
the resource IDs to search over (no value or an empty list will result in a search over all resources at the time of recovering the slug and searching) |
None
|
version
|
Optional[int]
|
the version to search at |
None
|
query
|
Optional[dict]
|
the query to search with |
None
|
query_version
|
Optional[str]
|
the query schema version to use |
None
|
pretty_slug
|
bool
|
whether to produce a pretty slug (es muy bonita) |
True
|
nav_slug
|
bool
|
whether to produce a nav type slug |
False
|
Returns:
| Type | Description |
|---|---|
|
details about the slug |
Source code in ckanext/versioned_datastore/logic/slug/action.py
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
vds_slug_reserve(context, current_slug, new_reserved_slug)
¶
Attempts to reserve the given slug under a new name. Each slug can only have one reserved name so if a reserved name already exists, the new name will overwrite it.
Note that only sysadmins can update a reserved slug name, but normal users can add a reserved name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
dict
|
the CKAN action context |
required |
current_slug
|
str
|
the current slug name |
required |
new_reserved_slug
|
str
|
the new slug name |
required |
Returns:
| Type | Description |
|---|---|
|
the slug details as a dict |
Source code in ckanext/versioned_datastore/logic/slug/action.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
vds_slug_resolve(slug)
¶
Resolves the given slug and returns the query details. If the provided slug string is a DOI and the query_dois plugin is loaded, this action also checks that plugin for DOIs and returns the query details of the DOI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slug
|
str
|
the slug to resolve |
required |
Returns:
| Type | Description |
|---|---|
|
the slug query details, or a ValidationError if no slug could be resolved |
Source code in ckanext/versioned_datastore/logic/slug/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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |