Custom Query (2152 matches)
Results (22 - 24 of 2152)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#1338 | fixed | Exception when trying to use a custom form schema from an extension | amercader | amercader |
Description |
Both with the package and group controllers, when overriding the default _db_to_form_schema method (which does nothing) from an extension, you get an exception because the context is not passed to the validators. File '/home/adria/dev/envs/iati/src/ckan/ckan/controllers/group.py', line 140 in edit old_data, errors = validate(old_data, schema) File '/home/adria/dev/envs/iati/src/ckan/ckan/lib/navl/dictization_functions.py', line 215 in validate converted_data, errors = _validate(flattened, schema, context) File '/home/adria/dev/envs/iati/src/ckan/ckan/lib/navl/dictization_functions.py', line 270 in _validate convert(converter, key, converted_data, errors, context) File '/home/adria/dev/envs/iati/src/ckan/ckan/lib/navl/dictization_functions.py', line 178 in convert converter(key, converted_data, errors, context) File '/home/adria/dev/envs/iati/src/ckan/ckan/logic/validators.py', line 108 in group_name_validator model = context['model'] KeyError: 'model' |
|||
#1354 | wontfix | Pass the context object to plugins implementing the IPackageController and IGroupController | amercader | amercader |
Description |
Plugins implementing some IPackageController or IGroupController operations (i.e. read, create, edit, delete) may need the context used in the logic action. For instance, to access the Session that created a package to perform additional queries from the extension (In that case the main logic action will still perform the final commit). |
|||
#1375 | fixed | Define new package id before sending it to the IPackageController plugins | amercader | amercader |
Description |
When creating a package, the package_create logic function sends the newly created package object to all plugins implementing the IPackageController interface https://bitbucket.org/okfn/ckan/src/93194933ea75/ckan/logic/action/create.py#cl-64 At this point, the changes have not yet been commited and the id of the package is not set (It has a default value of make_uuid, which is set when commited). For this reason, plugins have no way of knowing the package id. E.g. the spatial query plugin needs to know this id to link the package extent to the actual package. One possible solution would be to set the package id in the data dict received by package_create (if it's not defined): from ckan.model.types import make_uuid if not 'id' in data or not data['id']: data['id'] = make_uuid() |