[ckan-dev] Custom field persistence

Sean Hammond sean.hammond at okfn.org
Mon Jan 21 15:50:43 UTC 2013


> 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?




More information about the ckan-dev mailing list