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

Knud Hinnerk Möller knud at datalysator.com
Wed Mar 13 22:34:25 UTC 2013


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



More information about the ckan-dev mailing list