[CKAN-support] Structure of c.pkg?

Nigel Babu nigel.babu at okfn.org
Thu Mar 20 03:57:06 UTC 2014


The best way would be to do a package_show action function and not calling
the package model directly.

Nigel Babu

Developer  |  @nigelbabu <https://twitter.com/nigelbabu>

The Open Knowledge Foundation <http://okfn.org/>

Empowering through Open Knowledge

http://okfn.org/  |  @okfn <http://twitter.com/OKFN>  |  OKF on
Facebook<https://www.facebook.com/OKFNetwork> |
Blog <http://blog.okfn.org/>  |  Newsletter<http://okfn.org/about/newsletter>

 CKAN | http://ckan.org/ | @CKANproject
<http://twitter.com/CKANproject> |the world’s leading open-source data
portal platform


On 19 March 2014 20:16, Carlos Quiros <cquiros at qlands.com> wrote:

>  Hi,
>
> I am having this code:
>
> import ckan.plugins.toolkit as toolkit
> from ckan.lib.base import c, abort
> from ckan.model import Package
>
> class metadataDDIController(toolkit.BaseController):
>     def getMetadataDDI(self,id):
>         toolkit.response.content_type = 'application/xml'
>         c.pkg = Package.get(id)
>         if c.pkg is None:
>             abort(404, 'Dataset not found')
>         return '<?xml version="1.0" encoding="utf-8"?><body>' +
> c.pkg.description + '</body>'
>
> But I get that 'Package' object has no attribute 'description'
>
> How can I get the information of the package, particularly the extras?
>
> Thanks,
> Carlos
>
> _______________________________________________
> ckan-support mailing list
> ckan-support at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-support
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ckan-support/attachments/20140320/19db84bd/attachment-0003.html>


More information about the ckan-support mailing list