[ckan-dev] Deciding default value of field in datastore

Henrik Aagaard Sørensen BU1G at tmf.kk.dk
Wed Aug 7 06:44:15 UTC 2013


Personally I don't know if it's possible, I couldn't find such feature either.
However, we have solved a similar issue by just having the "middleware" which calls the API to set/update a field with a current timestamp.

Fra: ckan-dev-bounces at lists.okfn.org [mailto:ckan-dev-bounces at lists.okfn.org] På vegne af Lasse Vestergaard
Sendt: 6. august 2013 23:01
Til: CKAN Development Discussions
Emne: [ckan-dev] Deciding default value of field in datastore

Hi all.

I'm working on inserting data into the datastore, and wonder if it's possible to decide the default value of a field when i first create the datastore. For instance, I want to be able to have a sensor that just sends a single value to the datastore through the api. The datastore should then automatically set an other field with the timestamp of the insertion (more or less as it's done in Xively).

I know this is possible with postgresql in it self. I was just wondering if the datastore exploits this feature? I can't find find it anywhere in the source code or in the documentation of CKAN, but find it a little odd if it's not implemented in the datastore api. Since you already have gone through such a great amount of work, I just presumed that it was implemented. If it's accessible, please enlighten me, and if it's not, please enlighten me why.

Best regards

Lasse Vestergaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130807/1244bbca/attachment-0001.html>


More information about the ckan-dev mailing list