[ckan-discuss] CKAN DataStore Type
Adrià Mercader
adria.mercader at okfn.org
Mon Oct 21 12:06:13 BST 2013
Hi Yanting,
The paster datastore_upload command uses messytables to guess the
field formats of your file. In your case it assumes that it is a date
(datetime to to be precise) and stores it as such on the datastore.
The datastore is currently serializing datetimes as ISO 8601 date
representations and that's what Recline shows.
I don't think you can tweak the field definitions from the command
line paster command. If you want this field to be stored as a string
you will probably need to use the datastore API directly:
http://docs.ckan.org/en/latest/datastore.html#ckanext.datastore.logic.action.datastore_create
Note that the "fields" parameter allows you to define the type of each field.
http://docs.ckan.org/en/latest/datastore.html#fields
This is of course more painful that using the datastorer
Hope this helps,
Adrià
On 18 October 2013 05:35, Yanting Chen <mx.alexender at gmail.com> wrote:
> Hi All
>
> I installed the extension DataStorer on my CKAN site. Then, I uploaded a csv
> file which conatins a data field with value, like "2010/02/13"
>
> After I executed the command "paster datastore_upload", the datastore was
> created successfully. However, the value in that data field changed to this
> format "2010/02/13T00:00:00"
>
> Does anyone know how to set the data type in the command execution? or any
> methods?
>
> Thanks in advance.
>
> Yanting
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
>
More information about the ckan-discuss
mailing list