[ckan-dev] Modify Metadata with 2 different values

SUPPORT OPENCITIES, Bústia Compartida support.opencities at upf.edu
Tue Jul 9 16:41:51 UTC 2013


For example, how can i modify the resources url with the title?.

Something like this:

  def _changeurl(self,schema):
var = schema['title']
schema['resources']['url'].append(my_url_converter(var))
return schema

    def create_package_schema(self):
        schema = super(ExampleIDatasetFormPlugin,
self).create_package_schema()
        schema = self._modify_package_schema(schema)
schema = self._changeurl(schema)
        return schema


Because i want to put the "title" in the URL of the resource, like
http://url+title, but i can't modify the url with the field of the title
schema.

It's possible to do this?.


Thank you for your help and sorry my english.


2013/7/9 SUPPORT OPENCITIES, Bústia Compartida <support.opencities at upf.edu>

> Hi, I am improving the plugin that i was doing the last month, but i can't
> modify the plugin taking 2 different "fields" of the metadata.
>
> For example:
>
>     def _changeurl(self,schema):
> nombre = schema['title']
>
> schema['resources']['url'].append(nombre)
>  return schema
>
>     def create_package_schema(self):
>         schema = super(ExampleIDatasetFormPlugin,
> self).create_package_schema()
>         schema = self._modify_package_schema(schema)
> schema = self._changeurl(schema)
>         return schema
>
> With this i can only modify the resources url at the same time.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130709/d5675621/attachment-0001.html>


More information about the ckan-dev mailing list