gws.base.storage.core

Storage object.

Source code: gws.base.storage.core

Module Contents

class gws.base.storage.core.Verb

Bases: gws.Enum

Enumeration type.

Despite being declared as extending Enum (for IDE support), this class is actually just a simple object and intended to be used as a collection of attributes. It doesn’t provide any Enum-specific utilities.

The rationale behind this is that we need Enum members (e.g. Color.RED) to be scalars, and not complex objects as in the standard Enum.

read = 'read'
write = 'write'
list = 'list'
delete = 'delete'
class gws.base.storage.core.State(*args, **kwargs)

Bases: gws.Data

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

names: list[str]
canRead: bool
canWrite: bool
canCreate: bool
canDelete: bool
class gws.base.storage.core.Request(*args, **kwargs)

Bases: gws.Request

Command request.

verb: Verb
entryName: str | None
entryData: dict | None
class gws.base.storage.core.Response(*args, **kwargs)

Bases: gws.Response

Command response.

data: dict | None
state: State
class gws.base.storage.core.Config(*args, **kwargs)

Bases: gws.ConfigWithAccess

Storage configuration

providerUid: str | None

storage provider uid

categoryName: str | None

category name

class gws.base.storage.core.Props(*args, **kwargs)

Bases: gws.Props

Object properties.

state: State
class gws.base.storage.core.Object

Bases: gws.Node

Configurable GWS object.

provider: gws.StorageProvider
categoryName: str
configure()

Configuration hook.

configure_provider()
props(user)

Generate a Props struct for this object.

Parameters:

user – The user for which the props should be generated.

get_state_for(user)
handle_request(req: gws.WebRequester, p: Request) Response