gws.base.model.widget

Base class for field widgets.

Source code: gws.base.model.widget

Module Contents

class gws.base.model.widget.Config(*args, **kwargs)

Bases: gws.Config

Configuration for the widget.

readOnly: bool = False

The widget displays the value without allowing edits.

class gws.base.model.widget.Object

Bases: gws.ModelWidget

Base model widget.

Provides the readOnly flag and the props common to all widgets.

readOnly: bool

The widget displays the value without allowing edits.

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.model.widget.Props(*args, **kwargs)

Bases: gws.Props

Object properties.

readOnly: bool
type: str
uid: str

Unique ID.