[ckan-dev] dataset schema customization

David Read david.read at hackneyworkshop.com
Fri Dec 13 12:55:29 UTC 2013


Sean,

I'm looking at your changes from March when you removed
form_to_db_schema_options() from an IDatasetForm in favour of
update_package_schema(). At DGU since CKAN 1.5 we've altered the
schema based on properties of the dataset and the user, but with CKAN
2 I can't work out how to achieve that since context and data_dict are
no longer passed in.

https://github.com/okfn/ckan/blob/master/ckan/logic/action/update.py#L279

For instance, we have rules that say that datasets which are harvested
don't have to fill in the 'format' field of a resource, because that
info is not available, whereas if you fill in the form it is required.
BUT if a sysadmin comes along they can edit the harvested dataset in
the form (if he really wants to) and not need to fill in the format
field.

You mentioned the problem at the time and it would be great to know if
you addressed it:

> The only problem is that form_to_db_schema_options()'s params would have to be passed to form_to_db_schema() instead, which would break any existing IDatasetForm plugins whose form_to_db_schema() methods do not accept params.

https://lists.okfn.org/pipermail/ckan-dev/2013-March/004275.html

Dave



More information about the ckan-dev mailing list