gws.base.storage.manager

Storage manager.

Source code: gws.base.storage.manager

Module Contents

class gws.base.storage.manager.Config(*args, **kwargs)

Bases: gws.Config

Storage providers for data saved by users.

providers: list[gws.ext.config.storageProvider]

Storage providers.

class gws.base.storage.manager.Object

Bases: gws.StorageManager

Storage manager.

configure()

Configuration hook.

Called when the node is initialized. Raising an exception here aborts the creation of the node.

create_provider(cfg, **kwargs)

Create a storage provider and add it to the manager.

A provider with the same uid replaces the existing one.

Parameters:
  • cfg – Provider configuration.

  • **kwargs – Extra configuration values.

Returns:

The new provider.

find_provider(uid=None)

Find a storage provider.

Parameters:

uid – Provider uid. If not given, the first provider is returned.

Returns:

The provider, or None if not found.