Skip to content

Commit

Permalink
Improve the ITemplateHelpers docstrings
Browse files Browse the repository at this point in the history
Just make the docstrings a bit clearer and more explicit, and reference
the new example_itemplatehelpers extension.
  • Loading branch information
Sean Hammond authored and tobes committed Feb 22, 2013
1 parent 242ea9a commit 33e9672
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions ckan/plugins/interfaces.py
Expand Up @@ -511,14 +511,22 @@ def get_auth_functions(self):


class ITemplateHelpers(Interface):
"""
Allow adding extra template functions available via h variable
"""
'''Add custom template helper functions.
By implementing this plugin interface plugins can provide their own
template helper functions, which custom templates can then access via the
``h`` variable.
See ``ckanext/example_itemplatehelpers`` for an example plugin.
'''
def get_helpers(self):
"""
Should return a dict, the keys being the name of the helper
function and the values being the functions themselves.
"""
'''Return a dict mapping names to helper_functions.
The keys of the dict should be the names of the helper functions, and
the values should be the functions themselves.
'''


class IDatasetForm(Interface):
Expand Down

0 comments on commit 33e9672

Please sign in to comment.