gws.plugin.model_field.related_feature

Related Feature field

Represents a child->parent M:1 relationship to another model:

+-------------+         +--------------+
| model       |         | toModel      |
+-------------+         +--------------+
| fromKey     |-------->| toKey        |
+-------------+         +--------------+

The value of the field is the parent feature.

Source code: gws.plugin.model_field.related_feature

Package Contents

class gws.plugin.model_field.related_feature.Config(*args, **kwargs)

Bases: gws.base.model.related_field.Config

Basic config with permissions.

fromColumn: str

foreign key column in this table

toModel: str

related model

toColumn: str = ''

key column in the related model, primary key by default

class gws.plugin.model_field.related_feature.Props(*args, **kwargs)

Bases: gws.base.model.related_field.Props

Object properties.

class gws.plugin.model_field.related_feature.Object

Bases: gws.base.model.related_field.Object

Model field.

attributeType
configure_relationship()
do_init(feature, mc)
uids_for_key(rel: gws.base.model.related_field.RelRef, key, mc)
after_select(features, mc)
before_create(feature, mc)
before_update(feature, mc)
before_write(feature: gws.Feature, mc: gws.ModelContext)