[ckan-dev] Issues with adding a custom input field

Kirstein, Fabian fabian.kirstein at fokus.fraunhofer.de
Thu Jan 3 11:25:29 UTC 2013


Hello everyone,

this thread follows my "Customizing Forms in 2.0a"  thread. I have still issues adding some custom input fields, store the input and display it.
I try to explain what to do. I've started to write my own custom extension implementing IDatasetForm . I've overwritten the package_metadata_fields.html and add
an additional field, like this:
{{ form.input('release_date', label=_('Release Date'), id='field-release-date', placeholder=_('2011-06-13'), value=data.release_date, error=errors.release_date, classes=['control-medium']) }}
In the form_to_db_schema() method, I would like to store the value of the field as an extra field. I am not pretty sure how to access the inputted value.
Then I want to override additional_info.html to display the stored value. But I'm not really sure how to pass data to such a snippet. The c-object which
I can manipulate setup_template_variables() is not available in the snippet.

I would really appreciate any help. I can't be so hard to add a single input field, I guess I just have some misunderstandings.
Thanks a lot.











-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130103/41a8195e/attachment.html>


More information about the ckan-dev mailing list