[CKAN-support] How to store custom value in the same way tags are stored?

Carlos Quiros cquiros at qlands.com
Tue Mar 25 10:00:12 UTC 2014


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.

On 03/21/2014 05:49 PM, Carlos Quiros wrote:
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ckan-support/attachments/20140325/9839b291/attachment-0003.html>


More information about the ckan-support mailing list