[ckan-dev] Customize CKAN on a kind of deeper level

Max Ludwig maxe.ludwig at googlemail.com
Fri Oct 28 16:09:02 UTC 2011


Hi,

it's been a long time but I have now an instance of CKAN 1.5.1a running and
I'm currently exploring what's the best way to customize it for our needs.

One of the main points is, that we need two types of datasets ("Institution"
and "Project"). Unfortunatly the current domain model doesn't seem to map
this appropriately and we can't really wait for v2 of the domain model which
- as I saw - would do the job.

What I thought of, is: I just set a "type" attribute in an "extra" field. So
I created an extension and a custom template for creating a dataset based on
the original one. Although this may sound pretty easy, it was not. It took
hours to understand what's going on in the templates (partly because the
documentation on writing an extension is quite sparse and outdated) but I
think I got the clue now. I added a fieldset for my "type" field in the
new_package_form.html template which looks now like this (see line 33 to 37
for my additions):
http://pylonshq.com/pasties/b15acf6df376a3fc257259ce8427d90e
I naively hoped that this would be enough to add an "extra" field to the
package. It is not :P

So now my question is: is the way I'm going the right one? Because as far as
I can see now I have to custumize a lot more forms. And if I should keep on
working with that approach, how can I actually save my extra "type" field?

Thanks in advance

Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20111028/a182a30d/attachment.html>


More information about the ckan-dev mailing list