gws.plugin.model_field.related_feature_list

Related feature list field.

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

+--------------+       +-------------+
| parent table |       | child table |
+--------------+       +-------------+
| fromColumn   |-----<<| toColumn    |
+--------------+       +-------------+

The value of the field is a list of child features. fromColumn is the key column in this model’s table, by default its primary key; toColumn is the foreign key column in the child model.

The field is implemented as a relatedMultiFeatureList with a single child model, so it reads and writes the relationship in the same way. Without a configured widget, the field uses a featureList widget.

Example:

fields+ {
    name "pois"
    type "relatedFeatureList"
    fromColumn "id"
    toModel "model_poi"
    toColumn "category_id"
    widget.type "featureList"
}

Source code: gws.plugin.model_field.related_feature_list

Package Contents

class gws.plugin.model_field.related_feature_list.Config

Bases: gws.base.model.related_field.Config

Field listing related features in another model.

fromColumn: str = ''

Key column in this table, primary key by default.

toColumn: str

Foreign key column in the related model.

toModel: str

UID of the related model.

class gws.plugin.model_field.related_feature_list.Object

Bases: gws.plugin.model_field.related_multi_feature_list.Object

Related feature list field object.

configure_relationship()
class gws.plugin.model_field.related_feature_list.Props

Bases: gws.base.model.related_field.Props