gws.base.client.core

Client object and UI elements.

Source code: gws.base.client.core

Module Contents

class gws.base.client.core.Config(*args, **kwargs)

Bases: gws.ConfigWithAccess

UI elements and options of the browser client.

addElements: list[ElementConfig] | None

Elements to add to the inherited application element list.

elements: list[ElementConfig] | None

Client UI elements, replacing the inherited application list.

options: dict | None

Client options, merged with the application client options.

removeElements: list[ElementConfig] | None

Elements to remove from the inherited application element list.

class gws.base.client.core.Element

Bases: gws.Node

Client UI element.

An element of the browser client, identified by its tag, with element options and access rules.

after: str

Tag of the element this one was inserted after.

before: str

Tag of the element this one was inserted before.

options: dict

Element-specific options.

tag: str

Element tag, for example Toolbar.Print.

configure()

Configuration hook.

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

props(user)

Generate a Props struct for this object.

Do not call this method directly, use gws.props_of instead, which also checks permissions.

Parameters:

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

Returns:

A Props object or a dict. Nested objects are converted to props as well.

class gws.base.client.core.ElementConfig(*args, **kwargs)

Bases: gws.ConfigWithAccess

Client UI element.

after: str = ''

Tag of the element to insert this one after.

before: str = ''

Tag of the element to insert this one before.

options: dict | None

Element-specific options passed to the client.

tag: str

Element tag.

class gws.base.client.core.ElementProps(*args, **kwargs)

Bases: gws.Data

Client UI element properties.

tag: str
class gws.base.client.core.Object

Bases: gws.Client

Client object.

elements: list[Element]

Client UI elements.

options: dict

Client options.

configure()

Configuration hook.

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

props(user)

Generate a Props struct for this object.

Do not call this method directly, use gws.props_of instead, which also checks permissions.

Parameters:

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

Returns:

A Props object or a dict. Nested objects are converted to props as well.

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

Bases: gws.Data

Client properties.

elements: list[ElementProps] | None
options: dict | None