[CKAN-support] [Open Knowledge Foundation] Re: How to store custom value in the same way tags are stored?

Carlos Quiros notifications-support at okfn.zendesk.com
Tue Mar 25 10:00:45 UTC 2014


##- Please type your reply above this line -##

[Open Knowledge Foundation] Re: How to store custom value in the same way tags are stored?

This ticket (#218) has been updated.

----------------------------------------------

Carlos Quiros, Mar 25 10:00

I'm still waiting for an answer.

I created a new vocabulary for my countries and used "convert_to_tags", 
"convert_from_tags" but because the data in the form is coma separated 
the "convert_to_tags" returns "is not JSON serializable".

Again how should I convert the coma separated string so it is stored 
properly in tags?

Thanks,
Carlos.

----------------------------------------------

Carlos Quiros, Mar 21 14:50

Hi,

I would like to store "Regions" in the same way Tags are stored so I can 
use it in IFacets. Currently I am storing it as a value separated by 
coma using:

def _add_custom_metadata_to_schema(self, schema):
   schema.update({'ILRI_actyregions': 
[toolkit.get_validator('ignore_missing'),toolkit.get_converter('convert_to_extras')]})

But if I use it like that (coma separated) IFacets show for example 
"Kenya,Tanzania" and not Kenya and Tanzania separated.

So I guess I need to store Regions in the same way Tags are stored. How 
can I do this?

Thanks,
Carlos

--------------------------------
This email is a service from Open Knowledge Foundation.









[0172-SG40]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ckan-support/attachments/20140325/c58c592a/attachment-0002.html>


More information about the ckan-support mailing list