[ckan-dev] Issues with adding a custom input field
Kirstein, Fabian
fabian.kirstein at fokus.fraunhofer.de
Mon Jan 7 10:57:03 UTC 2013
Hello,
do you need any additional information to answer my question? I can't solve it by my own.
I tried to save the inputted value with schema.update and convert_to_extras methods, but I
am not sure how to apply it.
Thanks!
Von: ckan-dev-bounces at lists.okfn.org [mailto:ckan-dev-bounces at lists.okfn.org] Im Auftrag von Kirstein, Fabian
Gesendet: Donnerstag, 3. Januar 2013 12:25
An: ckan-dev at lists.okfn.org
Betreff: [ckan-dev] Issues with adding a custom input field
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/20130107/f3e23b9e/attachment-0001.html>
More information about the ckan-dev
mailing list