gws.base.model.related_field

Generic related field.

Source code: gws.base.model.related_field

Module Contents

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

Bases: gws.base.model.field.Config

Basic config with permissions.

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.

fromKey: gws.lib.sa.Column
table: gws.lib.sa.Table
toKey: gws.lib.sa.Column
class gws.base.model.related_field.Object

Bases: gws.base.model.field.Object

Model field.

model: gws.DatabaseModel
rel: Relationship
activate()

Activation hook.

column_or_uid(model, cfg)
configure_relationship()
configure_widget()
drop_uid_and_key(model: gws.DatabaseModel, key_column: gws.lib.sa.Column, uids: Iterable[gws.FeatureUid], delete: bool, mc: gws.ModelContext)
find_relatable_features(search, mc)
from_props(feature, mc)
get_model(uid: str) gws.DatabaseModel
key_for_uid(model: gws.DatabaseModel, key_column: gws.lib.sa.Column, uid: gws.FeatureUid, mc: gws.ModelContext)
post_configure()

Post-configuration hook.

related_field(to: RelRef) gws.ModelField | None
related_models()
to_props(feature, mc)
uid_and_key_for_keys(model: gws.DatabaseModel, key_column: gws.lib.sa.Column, keys: Iterable[gws.FeatureUid], mc: gws.ModelContext) set[tuple[gws.FeatureUid, gws.FeatureUid]]
uid_and_key_for_uids(model: gws.DatabaseModel, key_column: gws.lib.sa.Column, uids: Iterable[gws.FeatureUid], mc: gws.ModelContext) set[tuple[gws.FeatureUid, gws.FeatureUid]]
uids_to_keys(mc: gws.ModelContext, model: gws.DatabaseModel, key_column: gws.lib.sa.Column, uids: Iterable[gws.FeatureUid] | None = None, keys: Iterable[Any] | None = None)
update_key_for_uids(model: gws.DatabaseModel, key_column: gws.lib.sa.Column, uids: list[gws.FeatureUid], key: Any, mc: gws.ModelContext)
update_uid_and_key(model: gws.DatabaseModel, key_column: gws.lib.sa.Column, uid_and_key: Iterable[tuple[gws.FeatureUid, gws.FeatureUid]], mc: gws.ModelContext)
class gws.base.model.related_field.Props(*args, **kwargs)

Bases: gws.base.model.field.Props

Object properties.

class gws.base.model.related_field.Relationship(*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.

deleteCascade: bool = False
src: RelRef
to: RelRef
tos: list[RelRef]
class gws.base.model.related_field.RelRef(*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.

key: gws.lib.sa.Column
model: gws.DatabaseModel
table: gws.lib.sa.Table
uid: gws.lib.sa.Column