[ckan-dev] db_to_form_package_schema returns incomplete schema

Sean Hammond sean.hammond at okfn.org
Fri Jan 25 11:48:50 UTC 2013


> Hi Sean,
> 
> I'm not pretty sure if it is a bug, because I don't really understand
> in what ways the schema is used besides in custom form extensions. For
> example in the default_schema the image_url of a group is missing but
> it is part of default_group_schema.  So it seems those two schemas are
> combined somehow normally, but not when I'm using db_to_form_schema.

db_to_form_package_schema() is _only_ used when you call it from your
IDatasetForm plugin, it's not used internally by CKAN. It's purpose is
to return a complete "default" package schema that you can then modify
by adding your custom fields. So if there are fields that are part of
packages in CKAN by default but are missing from
db_to_form_package_schema(), that's a bug.

I realise this needs better documentation and examples, and also unit
tests so that bugs like this one can't creep in, we're working on it.




More information about the ckan-dev mailing list