[ckan-dev] UndefinedError: {[CUT...]} has no member named "id"
Sean Hammond
sean.hammond at okfn.org
Fri Feb 15 10:20:22 UTC 2013
> I've implemented a plugin for a new form for my Dataset (CKAN 1.8):
>
> class PatDatasetForm(SingletonPlugin, DefaultDatasetForm):
>
> implements(IDatasetForm, inherit=True)
> implements(IConfigurer, inherit=True)
>
> def is_fallback(self):
> return True
>
> def package_types(self):
> return ['dataset']
>
> ...
>
> The create form works fine but now, any time I try to access to the
> package view or to edit a previously created dataset, I get this error:
>
> File '/home/ivan/pyenv/src/ckan/ckan/templates/package/layout.html',
> line 40 in <Expression u"h.subnav_link(\n
> h.icon('authorization_group') + _('Followers
> ({num_followers})').format(num_followers=h.follow_count('dataset',
> c.pkg_dict.id)),\n controller='package',\n
> action='followers',\n id=c.pkg.name)">
> ${h.subnav_link(
> File '/home/ivan/pyenv/src/ckan/ckan/config/environment.py', line 269 in
> genshi_lookup_attr
> val = cls.undefined(key, owner=obj)
> File
> '/home/ivan/pyenv/local/lib/python2.7/site-packages/genshi/template/eval.py',
> line 410 in undefined
> raise UndefinedError(key, owner=owner)
>
> UndefinedError: {[CUT...]} has no member named "id"
>
> Any ideas?
I think I need to see the rest of your PatDatasetForm class. This looks
like a schema problem. Have you implemented the form_to_db_schema() and
db_to_form_schema() methods?
More information about the ckan-dev
mailing list