Skip to content

Commit

Permalink
[#2842] Add config to the plugins toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jul 13, 2016
1 parent a77ff9c commit 37ecbe8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ckan/plugins/toolkit.py
Expand Up @@ -18,6 +18,8 @@ class _Toolkit(object):
# contents should describe the available functions/objects. We check
# that this list matches the actual availables in the initialisation
contents = [
# Global CKAN configuration object
'config',
# i18n translation
'_',
# i18n translation (plural form)
Expand Down Expand Up @@ -144,6 +146,14 @@ def _initialize(self):
t = self._toolkit

# imported functions
t['config'] = common.config
self.docstring_overrides['config'] = '''The CKAN configuration object.
It stores the configuration values defined in the :ref:`config_file`, eg::
title = toolkit.config.get("ckan.site_title")
'''
t['_'] = common._
self.docstring_overrides['_'] = '''The Pylons ``_()`` function.
Expand Down

0 comments on commit 37ecbe8

Please sign in to comment.