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

Max Ludwig maxe.ludwig at googlemail.com
Tue Nov 1 14:19:32 UTC 2011


2011/11/1 Rufus Pollock <rufus.pollock at okfn.org>

> On 28 October 2011 17:09, Max Ludwig <maxe.ludwig at googlemail.com> wrote:
> > Hi,
>
> Sorry for slightly slow reply!
>

No problem :)

 Institution would surely map to Group while Project would map to
> "Dataset". We already have deployments supporting the first mapping
> and the second is "just" a mapping question. I also note we are in
> final stages of planning the "Groups Refactor" which is the major part
> of of Domain Model v2: <http://wiki.ckan.org/Groups_Refactor>


Hmm, I should try this way ... although I'm pretty sure I thought about it
but I can't remember why I discarded this idea (I should write down those
things -.-).

> 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
>
> Any feedback on what we should improve there is very welcome (however
> critical!) :-)
>

Is there an entity relationship model so I can see how the components of a
dataset (extras, resources, ...) work together?


>
> > 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
>
> It's a little tricky to see what you've changed there. Could you
> highlight what you've added / removed?
>

Well it is basically just this file

https://bitbucket.org/okfn/ckan/src/ba47e53da1c1/ckan/templates/package/new_package_form.html

and .. woops, sorry, wrong lines .. I added lines 31 to 35.


>
> > 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?
>
> This should be reasonably straightforward. If you ever can drop in to
> ckan-dev I can try and assist in putting this together. In addition if
> I have a moment, I'll try to put together a simple example of doing
> this.
>


Sorry, drop into what? Besides, if it is possible for us to use groups
(have to think about it) than this whole issue would vanish into thin air :P

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


More information about the ckan-dev mailing list