[ckan-dev] Access to pkg_dict in resource form

Khalegh Ahmadi khalegh at highwaythreesolutions.com
Fri Feb 28 06:13:07 UTC 2014


Hi Pabitra,

Thank you so much. That is exactly what I did. I used a helper function which uses show_package action to get the dataset info given the package id/name.

Thanks again,
Khalegh
On Feb 27, 2014, at 9:07 PM, Pabitra Dash <pkdash_reena at hotmail.com> wrote:

> Hi Khalegh,
>  
> I think you can access the dataset type through a helper method (get_helpers() of the ITempletHelper interface). I am using such a helper method (h.get_dataset_type()) in order to build my first form of the dataset create process to show appropriate custom dataset metadata elements depending upon the dataset type.
>  
> Pabitra
> 
> 
> 
>  
> > From: khalegh at highwaythreesolutions.com
> > Date: Thu, 27 Feb 2014 10:40:48 -0800
> > To: ckan-dev at lists.okfn.org
> > Subject: [ckan-dev] Access to pkg_dict in resource form
> > 
> > Hi everybody,
> > 
> > Does anybody know how can I have access to the value of dataset type ( pkg_dict[‘type’]) in the resource form? I have different dataset types and when I create a dataset of a particular type, I want to know the type of dataset in the second stage(Add data) but I don’t know how to get the value of dataset type in data dictionary. I tried to use pkg_dict[’type’] in new_resource.html template but it returns nothing.
> > 
> > Best,
> > Khalegh
> > 
> > 
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140227/776be809/attachment-0003.html>


More information about the ckan-dev mailing list