[ckan-dev] Custom field persistence

Toby Dacre toby.okfn at gmail.com
Mon Jan 21 15:55:48 UTC 2013


On 21 January 2013 15:50, Sean Hammond <sean.hammond at okfn.org> wrote:

> > In my situation I have more complex data that requires persistence in
> > another dedicated table. How can I accomplish this? That is to say,
> > can I create a custom field that is not handled through the standard
> > extra fields mechanisms?
>
> As far as I know, no. What is your more complex data requirement,
> exactly?
>
> > I'm also curious if there is some documentation about the structure of
> > the schema object returned by ckan.logic.schema.package_form_schema?
> > When I add properties to the object, I add a list of entries, but what
> > goes into that list? I'm hoping that through that schema object I can
> > implement custom functions to persist additional content. Am I on the
> > right track?
>
> I'm not sure whether you can do this (use custom functions in the schema
> to persist additional content) or whether that would be a good idea if
> you could. The problem is that, as I understand it, at the model level,
> i.e. in the database, the package table has certain columns. One of
> these is the "extras" column which is meant for storing custom data. If
> you want to store custom data, but you don't want to store it in the
> extras column, then I'm not sure if there's anything you can do, I don't
> think there's a good way for plugins to add their own columns or tables
> to the database.
>
> Anyone else?
>

Adding extra columns to existing tables is asking for trouble. Adding new
tables should be fine though aren't there some extensions like the archiver
that do this?

>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130121/ac332f60/attachment-0001.html>


More information about the ckan-dev mailing list