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

Tom Rees zephod at gmail.com
Tue Nov 8 11:52:48 UTC 2011


Hey Max,
Did groups work out for you in the end?
I think using Groups, or using the Extras table, will be a much simpler
solution for you than trying to use a custom db schema. To do that, you'll
need to do a lot more than modify the front-end web form (see
ckan/logic/schema.py for example).
I think Rufus meant you can drop in to #ckan on irc.freenode.net, where the
team hangs out on a regular basis. :)
Tom

On Tue, Nov 1, 2011 at 2:19 PM, Max Ludwig <maxe.ludwig at googlemail.com>wrote:

> 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
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20111108/311340c3/attachment-0001.html>


More information about the ckan-dev mailing list