Die Dokumentation ab Version 39.5.17 von PLANTA project finden Sie in der neuen PLANTA Online-Hilfe.

global_setting

This package lets you read global settings.

Functions

Function Parameters Return Value Description
cache_clear()     Clears the global setting cache. Note that saving in the default PLANTA global settings module calls this function
get_global_setting_value(python_id, attribute, value_type=None, default=None) python_id: The Python-ID of the global setting to retrieve.
attribute: The attribute of the global setting to retrieve. Valid values are class, alpha120, python_id, parameter, description, template_code and invisible.

value_type: Determines the type the return value should be converted to. For example int or str.
default: The value that should be returned if no global setting with the given python_id exists.
The value of the global setting or the default if the setting does not exist. If no default was given and the setting does not exist a ValueError is raised. Retrieves a global setting. After retrieving a value once it will be cached until cache_clear() is called.

Examples

Reading a global setting

from ppms.global_setting import get_global_setting_value

module_id = get_global_setting_value(python_id='profiling_dialog_module', attribute='alpha120', default='009CQE')

         PLANTA project









 
  • Suche in Topic-Namen

  • Suche in Topic-Inhalten
This site is powered by the TWiki collaboration platform Powered by Perl