[ckan-dev] Removing Facets with Plugin
Trenton Manson
tmanson at onipaa.org
Tue Dec 10 22:54:26 UTC 2019
Aloha,
I was trying to remove the license and format facets be deleting from the `facets_dict` through the IFacets plugin interface with like below.
plugins.implements(plugins.IFacets)
def dataset_facets(self, facets_dict, package_type):
'''Add new search facet (filter) for datasets.
This must be a field in the dataset (or organization or
group if you're modifying those search facets, just change the function).
'''
del facets_dict['license']
del facets_dict['res_format']
# Return the updated facet dict.
return facets_dict
This crashes the page. Am I taking the wrong approach? Any advice is appreciated.
Mahalo nui,
[/var/folders/hx/np81c8v9461db4wp5r1_6qrr0000gn/T/com.microsoft.Outlook/Content.MSO/3155E392.tmp]
Trenton Manson | Data Science Manager
1100 Alakea Street | Honolulu, HI 96813
Cell: 808.421.9832 | Website: www.onipaa.org<http://www.onipaa.org/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20191210/8248d5a9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9982 bytes
Desc: image001.png
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20191210/8248d5a9/attachment-0001.png>
More information about the ckan-dev
mailing list