[ckan-dev] genshi.template.eval.UndefinedError caused by db_to_form_schema()

Adrià Mercader adria.mercader at okfn.org
Fri Mar 15 09:56:30 UTC 2013


Hi Knud,
A plain 1.8 install and your extension does not give me any error, so
I suspect something else is going wrong.
Do you have any other extensions running which modify the templates or
the schema?

Adrià


On 13 March 2013 22:34, Knud Hinnerk Möller <knud at datalysator.com> wrote:
> Hi,
>
> I'm experiencing a weird bug when implementing the optional db_to_form_schema() function of IDatasetForm in CKAN1.8. There are several places in various templates where model.package.isopen() is called (e.g., in templates/snippets/package_list.html). When I minimally implement db_to_form_schema() as below, these calls fail with a genshi.template.eval.UndefinedError ("… has no member named "isopen").
>
>     def db_to_form_schema(self):
>
>         # get base dataset schema
>         schema = logic.schema.db_to_form_package_schema()
>
>         return schema
>
>
> I'm unsure what is causing this - from what I can tell, the function as defined above is simply returning the default package schema, which shouldn't cause any problems. I have put together a minimal plugin which isn't doing much else than implementing this method, if you want to try to replicate this error:
>
> https://github.com/knudmoeller/ckanext-test
>
> Any help in figuring out what is happening and how to solve this would be highly appreciated!
>
> Cheers,
> Knud
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev




More information about the ckan-dev mailing list