[ckan-dev] dataset schema customization

Ian Ward ian at excess.org
Fri Dec 13 13:37:58 UTC 2013


I'm going to need a solution for this soon as well.

My scheming extension needs to know the dataset type to return the correct
schemas. This works with the existing old *_options() methods still used
for groups and organizations, but there is no way for me to do the same
with datasets.
On Dec 13, 2013 7:55 AM, "David Read" <david.read at hackneyworkshop.com>
wrote:

> 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
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20131213/6707442d/attachment-0003.html>


More information about the ckan-dev mailing list