Logo Search packages:      
Sourcecode: zine version File versions  Download package

def zine::application::Zine::add_config_var (   self,
  key,
  field 
)

Add a configuration variable to the application.  The config
variable should be named ``<plugin_name>/<variable_name>``.  The
`variable_name` itself must not contain another slash.  Variables
that are not prefixed are reserved for Zine' internal usage.
The `field` is an instance of a field class from zine.utils.forms
that is used to validate the variable. It has to contain the default
value for that variable.

Example usage::

    app.add_config_var('my_plugin/my_var', BooleanField(default=True))

Definition at line 937 of file application.py.

00937                                         :
        """Add a configuration variable to the application.  The config
        variable should be named ``<plugin_name>/<variable_name>``.  The
        `variable_name` itself must not contain another slash.  Variables
        that are not prefixed are reserved for Zine' internal usage.
        The `field` is an instance of a field class from zine.utils.forms
        that is used to validate the variable. It has to contain the default
        value for that variable.

        Example usage::

            app.add_config_var('my_plugin/my_var', BooleanField(default=True))
        """
        if key.count('/') > 1:
            raise ValueError('key might not have more than one slash')
        self.cfg.config_vars[key] = field

    @setuponly
    def add_url_rule(self, rule, **kwargs):


Generated by  Doxygen 1.6.0   Back to index