probator.config.
DBConfig
¶Bases: object
Database backed configuration object.
Styled to work similarly to Flask’s builtin config object, with the added feature that it understands namespaced configuration items to allow for duplicate names within different scopes.
reload_data
()¶Reloads the configuration from the database
Returns: | None |
---|
namespace_exists
(namespace)¶Checks if a namespace exists
Parameters: | namespace (str) – Namespace to check for |
---|---|
Returns: | True if namespace exists, else False |
key_exists
(namespace, key)¶Checks a namespace for the existance of a specific key
Parameters: | |
---|---|
Returns: | True if key exists in the namespace, else False |
get
(key, namespace='default', default=None, as_object=False)¶Return the value of a key/namespace pair
Parameters: | |
---|---|
Returns: | Requested value if found, else default value or None |
set
(namespace, key, value, description=None)¶Set (create/update) a configuration item
Parameters: |
|
---|---|
Returns: | None |
delete
(namespace, key)¶Remove a configuration item from the database
Parameters: |
|
---|---|
Returns: | None |