gws.base.model.core

Base model.

Source code: gws.base.model.core

Module Contents

class gws.base.model.core.TableViewColumn(*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.

name: str
width: int | None
class gws.base.model.core.Config(*args, **kwargs)

Bases: gws.ConfigWithAccess

Model configuration

fields: list[gws.ext.config.modelField] | None

model fields

loadingStrategy: gws.FeatureLoadingStrategy | None

loading strategy for features

title: str = ''

model title

isEditable: bool = False

this model is editable

withAutoFields: bool = False

autoload non-configured model fields from the source

excludeColumns: list[str] | None

exclude columns names from autoload

withTableView: bool = True

enable table view for this model

tableViewColumns: list[TableViewColumn] | None

fields to include in the table view

templates: list[gws.ext.config.template] | None

feature templates

sort: list[gws.SortOptions] | None

default sorting

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

Bases: gws.Props

Object properties.

canCreate: bool
canDelete: bool
canRead: bool
canWrite: bool
isEditable: bool
fields: list[gws.ext.props.modelField]
geometryCrs: str | None
geometryName: str | None
geometryType: gws.GeometryType | None
layerUid: str | None
loadingStrategy: gws.FeatureLoadingStrategy
supportsGeometrySearch: bool
supportsKeywordSearch: bool
tableViewColumns: list[TableViewColumn]
title: str
uid: str
uidName: str | None
class gws.base.model.core.Object

Bases: gws.Model

Data Model.

configure()

Configuration hook.

post_configure()

Post-configuration hook.

configure_model()

Model configuration protocol.

configure_provider()
configure_sources()
configure_fields()
configure_auto_fields()
configure_uid()
configure_geometry()
configure_sort()
configure_templates()
props(user)

Generate a Props struct for this object.

Parameters:

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

table_view_columns(user)
field(name)
validate_feature(feature, mc)
related_models()
get_features(uids, mc)
find_features(search, mc)
feature_from_props(props, mc)
feature_to_props(feature, mc)
feature_to_view_props(feature, mc)