mxcubeweb.core.models.configmodels#

Classes

AppConfigModel(*, server, mxcube[, sso, braggy])

BraggyConfigModel(*[, BRAGGY_URL, USE_BRAGGY])

FlaskConfigModel(*[, SECRET_KEY, DEBUG, ...])

MXCUBEAppConfigModel(*[, VIDEO_FORMAT, ...])

ModeEnum(value[, names, module, qualname, ...])

ResourceHandlerConfigModel(*[, url_prefix, ...])

Configuration modle for resource handler.

SSOConfigModel(*[, USE_SSO, ISSUER, ...])

UICameraConfigModel(*, id, components)

UIComponentModel(*, label, attribute[, ...])

UIPropertiesListModel(*[, sample_view, ...])

UIPropertiesModel(*, id, components)

UISampleListViewModesModel(*[, id, components])

UISampleViewMotorsModel(*, id, components)

UISampleViewVideoControlsModel(*, id, components)

UISessionPickerModel(*[, id, tabs])

UiSessionPickerTabs(*[, active, scheduled, ...])

UserManagerConfigModel(*[, class_name, ...])

UserManagerUserConfigModel(*[, username, role])

class mxcubeweb.core.models.configmodels.AppConfigModel(*, server: FlaskConfigModel, mxcube: MXCUBEAppConfigModel, sso: SSOConfigModel | None = None, braggy: BraggyConfigModel | None = None)[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'braggy': FieldInfo(annotation=Union[BraggyConfigModel, NoneType], required=False, default=None), 'mxcube': FieldInfo(annotation=MXCUBEAppConfigModel, required=True), 'server': FieldInfo(annotation=FlaskConfigModel, required=True), 'sso': FieldInfo(annotation=Union[SSOConfigModel, NoneType], required=False, default=None)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.BraggyConfigModel(*, BRAGGY_URL: str = '', USE_BRAGGY: bool = False)[source]#

Bases: BaseModel

Parameters:
  • BRAGGY_URL (str) –

  • USE_BRAGGY (bool) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'BRAGGY_URL': FieldInfo(annotation=str, required=False, default='', description='Base URL for braggy server'), 'USE_BRAGGY': FieldInfo(annotation=bool, required=False, default=False, description='Set to True to use braggy for displaying images')}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.FlaskConfigModel(*, SECRET_KEY: str = b'o`\xb5\xa5\xc2\x8c\xb2\x8c-?\xe0,/i#c', DEBUG: bool = False, ALLOWED_CORS_ORIGINS: list[str] = [], SECURITY_PASSWORD_SALT: str = 'ASALT', SECURITY_TRACKABLE: bool = True, USER_DB_PATH: str = '/home/runner/.local/share/mxcube/mxcube-user.db', HOST: str = '127.0.0.1', PORT: int = 8081, PERMANENT_SESSION_LIFETIME: timedelta, CERT_KEY: str = '', CERT_PEM: str = '', CERT: str = 'NONE', RATE_LIMITER_ENABLED: bool = True, RATELIMIT_DEFAULT: str = '150000 per day;6000 per hour', RATELIMIT_STORAGE_URI: str = 'memory://', RATELIMIT_HEADERS_ENABLED: bool = True, CSP_ENABLED: bool = True, CSP_POLICY: dict[str, list[str]] = {}, CSP_REPORT_ONLY: bool = False, CSP_REPORT_URI: str = '')[source]#

Bases: BaseModel

Parameters:
  • SECRET_KEY (str) –

  • DEBUG (bool) –

  • ALLOWED_CORS_ORIGINS (list[str]) –

  • SECURITY_PASSWORD_SALT (str) –

  • SECURITY_TRACKABLE (bool) –

  • USER_DB_PATH (str) –

  • HOST (str) –

  • PORT (int) –

  • PERMANENT_SESSION_LIFETIME (timedelta) –

  • CERT_KEY (str) –

  • CERT_PEM (str) –

  • CERT (str) –

  • RATE_LIMITER_ENABLED (bool) –

  • RATELIMIT_DEFAULT (str) –

  • RATELIMIT_STORAGE_URI (str) –

  • RATELIMIT_HEADERS_ENABLED (bool) –

  • CSP_ENABLED (bool) –

  • CSP_POLICY (dict[str, list[str]]) –

  • CSP_REPORT_ONLY (bool) –

  • CSP_REPORT_URI (str) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'ALLOWED_CORS_ORIGINS': FieldInfo(annotation=list[str], required=False, default=[], description=''), 'CERT': FieldInfo(annotation=str, required=False, default='NONE', description="One of the strings ['SIGNED', 'ADHOC', NONE]"), 'CERT_KEY': FieldInfo(annotation=str, required=False, default='', description='Full path to signed certificate key file'), 'CERT_PEM': FieldInfo(annotation=str, required=False, default='', description='Full path to signed certificate pem file'), 'CSP_ENABLED': FieldInfo(annotation=bool, required=False, default=True), 'CSP_POLICY': FieldInfo(annotation=dict[str, list[str]], required=False, default={}), 'CSP_REPORT_ONLY': FieldInfo(annotation=bool, required=False, default=False, description="Set to True to enable report-only mode (won't block content)"), 'CSP_REPORT_URI': FieldInfo(annotation=str, required=False, default='', description='URI for CSP violation reports (empty to disable reporting)'), 'DEBUG': FieldInfo(annotation=bool, required=False, default=False, description=''), 'HOST': FieldInfo(annotation=str, required=False, default='127.0.0.1', description='Host address to bind to'), 'PERMANENT_SESSION_LIFETIME': FieldInfo(annotation=timedelta, required=True), 'PORT': FieldInfo(annotation=int, required=False, default=8081, description='Port to bind to'), 'RATELIMIT_DEFAULT': FieldInfo(annotation=str, required=False, default='150000 per day;6000 per hour'), 'RATELIMIT_HEADERS_ENABLED': FieldInfo(annotation=bool, required=False, default=True), 'RATELIMIT_STORAGE_URI': FieldInfo(annotation=str, required=False, default='memory://'), 'RATE_LIMITER_ENABLED': FieldInfo(annotation=bool, required=False, default=True), 'SECRET_KEY': FieldInfo(annotation=str, required=False, default=b'o`\xb5\xa5\xc2\x8c\xb2\x8c-?\xe0,/i#c', description='Flask secret key'), 'SECURITY_PASSWORD_SALT': FieldInfo(annotation=str, required=False, default='ASALT', description=''), 'SECURITY_TRACKABLE': FieldInfo(annotation=bool, required=False, default=True, description=''), 'USER_DB_PATH': FieldInfo(annotation=str, required=False, default='/home/runner/.local/share/mxcube/mxcube-user.db', description='')}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.MXCUBEAppConfigModel(*, VIDEO_FORMAT: str = 'MPEG1', VIDEO_STREAM_URL: str = '', VIDEO_STREAM_PORT: int = 8000, MXCUBE_STARTS_VIDEO_STREAM: bool = True, USE_GET_SAMPLES_FROM_SC: bool = True, AUTOSYNC_LIMS: bool = False, mode: ModeEnum = ModeEnum.OSC, LOCAL_DOMAINS: list[str] = [], SESSION_REFRESH_INTERVAL: int = 9000, usermanager: UserManagerConfigModel, ui_properties: dict[str, mxcubeweb.core.models.configmodels.UIPropertiesModel] = {})[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'AUTOSYNC_LIMS': FieldInfo(annotation=bool, required=False, default=False, description='True to synchronize samples with LIMS on proposal selection'), 'LOCAL_DOMAINS': FieldInfo(annotation=list[str], required=False, default=[], description="If the connected client's hostname ends with one of these domains, it will be considered 'local'"), 'MXCUBE_STARTS_VIDEO_STREAM': FieldInfo(annotation=bool, required=False, default=True, description="Invoke 'start OAV stream' method on the Camera hardware object"), 'SESSION_REFRESH_INTERVAL': FieldInfo(annotation=int, required=False, default=9000, description='Session refresh interval in milliseconds'), 'USE_GET_SAMPLES_FROM_SC': FieldInfo(annotation=bool, required=False, default=True, description='True to activate or be able to get samples from the sample changer, false otherwise'), 'VIDEO_FORMAT': FieldInfo(annotation=str, required=False, default='MPEG1', description='Video format MPEG1 or MJPEG'), 'VIDEO_STREAM_PORT': FieldInfo(annotation=int, required=False, default=8000, description='Video stream PORT'), 'VIDEO_STREAM_URL': FieldInfo(annotation=str, required=False, default='', description='Video stream URL, URL used by client to get video stream'), 'mode': FieldInfo(annotation=ModeEnum, required=False, default=<ModeEnum.OSC: 'OSC'>, description='MXCuBE mode OSC, SSX-CHIP or SSX-INJECTOR'), 'ui_properties': FieldInfo(annotation=dict[str, UIPropertiesModel], required=False, default={}), 'usermanager': FieldInfo(annotation=UserManagerConfigModel, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.ModeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

class mxcubeweb.core.models.configmodels.ResourceHandlerConfigModel(*, url_prefix: str = '', name: str | None = None, exports: list[dict[str, str | list]] = [], commands: list[str] = [], attributes: list[str] = [])[source]#

Bases: BaseModel

Configuration modle for resource handler.

Used to define which adapter properties and methods that are exported over HTTP. An endpoint for each method and/or property is created by the AdapterResourceHandler and attached to the server.

The exports list defines the methods and properties exported, the HTTP verb to use and the decorators to apply to the view function,

The format is:

[
    {"attr": "get_value", "method": "PUT", "decorators": []},
]

Where “attr” is the method or property of the adapter, “method” is the http verb i.e GET, PUT, POST. and decoratoes are a list decroator functions to apply to the resulting view function.

There are two structures that can be used for convenience, that use defualt vlaues for “method” and “decorators”. These are commands and attributes.

Commands is list of functions/methods to export. A dictionary like the one above:

({"attr": "get_value", "method": "PUT", "decorators": []})

Will be generated from the commands list. With the values “method” and decorators set to defualt values, PUT and [restrict, require_control]

Example:

commands = ["set_value", "get_value"]

Will export the methods as …/set_value with HTTP verb PUT

In the same way:

Example:

attributes = ["data"]

Will export the property as …/data with HTTP verb GET

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'attributes': FieldInfo(annotation=list[str], required=False, default=[], description='List of exported properties, defaulted to HTTP GET'), 'commands': FieldInfo(annotation=list[str], required=False, default=[], description='List of exported methods, defualted to HTTP PUT'), 'exports': FieldInfo(annotation=list[dict[str, Union[str, list]]], required=False, default=[], description='List of dictionaires specifying each of the exported attributes or methods, HTTP method to use and decorators to apply '), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description=('Name of the resource handler, if not given the class name (lower case) ', 'is used')), 'url_prefix': FieldInfo(annotation=str, required=False, default='', description='URL prefix')}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.SSOConfigModel(*, USE_SSO: bool = False, ISSUER: str = '', LOGOUT_URI: str = '', CLIENT_SECRET: str = '', CLIENT_ID: str = '', META_DATA_URI: str = '', SCOPE: str = 'openid email profile', CODE_CHALLANGE_METHOD: str = 'S256')[source]#

Bases: BaseModel

Parameters:
  • USE_SSO (bool) –

  • ISSUER (str) –

  • LOGOUT_URI (str) –

  • CLIENT_SECRET (str) –

  • CLIENT_ID (str) –

  • META_DATA_URI (str) –

  • SCOPE (str) –

  • CODE_CHALLANGE_METHOD (str) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'CLIENT_ID': FieldInfo(annotation=str, required=False, default='', description='OpenIDConnect / OAuth  client id'), 'CLIENT_SECRET': FieldInfo(annotation=str, required=False, default='', description='OpenIDConnect / OAuth client secret'), 'CODE_CHALLANGE_METHOD': FieldInfo(annotation=str, required=False, default='S256', description='OpenIDConnect / OAuth Challange'), 'ISSUER': FieldInfo(annotation=str, required=False, default='', description='OpenIDConnect / OAuth Issuer URI'), 'LOGOUT_URI': FieldInfo(annotation=str, required=False, default='', description='OpenIDConnect / OAuth logout URI'), 'META_DATA_URI': FieldInfo(annotation=str, required=False, default='', description='OpenIDConnect / OAuth  .well-known configuration'), 'SCOPE': FieldInfo(annotation=str, required=False, default='openid email profile', description='OpenIDConnect / OAuth scope'), 'USE_SSO': FieldInfo(annotation=bool, required=False, default=False, description='Set to True to use SSO')}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UICameraConfigModel(*, id: str, components: list[mxcubeweb.core.models.configmodels._UICameraConfigModel])[source]#

Bases: UIPropertiesModel

Parameters:
  • id (str) –

  • components (list[mxcubeweb.core.models.configmodels._UICameraConfigModel]) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'components': FieldInfo(annotation=list[_UICameraConfigModel], required=True), 'id': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UIComponentModel(*, label: str, attribute: str, role: str | None = None, step: float | None = None, precision: int | None = None, suffix: str | None = None, description: str | None = None, value_type: str | None = None, object_type: str | None = None, format: str | None = None, invert_color_semantics: bool | None = None)[source]#

Bases: BaseModel

Parameters:
  • label (str) –

  • attribute (str) –

  • role (str | None) –

  • step (float | None) –

  • precision (int | None) –

  • suffix (str | None) –

  • description (str | None) –

  • value_type (str | None) –

  • object_type (str | None) –

  • format (str | None) –

  • invert_color_semantics (bool | None) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'attribute': FieldInfo(annotation=str, required=True), 'description': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'format': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'invert_color_semantics': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'label': FieldInfo(annotation=str, required=True), 'object_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'precision': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'role': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'step': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'suffix': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'value_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UIPropertiesListModel(*, sample_view: UIPropertiesModel | None = None, beamline_setup: UIPropertiesModel, camera_setup: UICameraConfigModel | None = None, sample_view_motors: UISampleViewMotorsModel, sample_list_view_modes: UISampleListViewModesModel = UISampleListViewModesModel(id='sample_list_view_modes', components=[_UISampleListViewModesComponentModel(id='table_view', show=True), _UISampleListViewModesComponentModel(id='graphical_view', show=True)]), sample_view_video_controls: UISampleViewVideoControlsModel | None = None, session_picker: UISessionPickerModel = UISessionPickerModel(id='session_picker', tabs=UiSessionPickerTabs(active=True, scheduled=True, other_beamlines=True, all_sessions=False)))[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'beamline_setup': FieldInfo(annotation=UIPropertiesModel, required=True), 'camera_setup': FieldInfo(annotation=Union[UICameraConfigModel, NoneType], required=False, default=None), 'sample_list_view_modes': FieldInfo(annotation=UISampleListViewModesModel, required=False, default=UISampleListViewModesModel(id='sample_list_view_modes', components=[_UISampleListViewModesComponentModel(id='table_view', show=True), _UISampleListViewModesComponentModel(id='graphical_view', show=True)])), 'sample_view': FieldInfo(annotation=Union[UIPropertiesModel, NoneType], required=False, default=None), 'sample_view_motors': FieldInfo(annotation=UISampleViewMotorsModel, required=True), 'sample_view_video_controls': FieldInfo(annotation=Union[UISampleViewVideoControlsModel, NoneType], required=False, default=None), 'session_picker': FieldInfo(annotation=UISessionPickerModel, required=False, default=UISessionPickerModel(id='session_picker', tabs=UiSessionPickerTabs(active=True, scheduled=True, other_beamlines=True, all_sessions=False)))}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UIPropertiesModel(*, id: str, components: list[mxcubeweb.core.models.configmodels.UIComponentModel])[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'components': FieldInfo(annotation=list[UIComponentModel], required=True), 'id': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UISampleListViewModesModel(*, id: Literal['sample_list_view_modes'] = 'sample_list_view_modes', components: list[mxcubeweb.core.models.configmodels._UISampleListViewModesComponentModel] = None)[source]#

Bases: BaseModel

Parameters:
  • id (Literal['sample_list_view_modes']) –

  • components (list[mxcubeweb.core.models.configmodels._UISampleListViewModesComponentModel]) –

classmethod check_at_least_one_component_shown(components: list[mxcubeweb.core.models.configmodels._UISampleListViewModesComponentModel]) list[mxcubeweb.core.models.configmodels._UISampleListViewModesComponentModel][source]#

Validate that at least one component in the list has ‘show’ set to True.

Parameters:

components (list[mxcubeweb.core.models.configmodels._UISampleListViewModesComponentModel]) –

Return type:

list[mxcubeweb.core.models.configmodels._UISampleListViewModesComponentModel]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'components': FieldInfo(annotation=list[_UISampleListViewModesComponentModel], required=False, default_factory=<lambda>, description='List of components for sample list view modes'), 'id': FieldInfo(annotation=Literal['sample_list_view_modes'], required=False, default='sample_list_view_modes')}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UISampleViewMotorsModel(*, id: str, components: list[mxcubeweb.core.models.configmodels.UIComponentModel])[source]#

Bases: UIPropertiesModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'components': FieldInfo(annotation=list[UIComponentModel], required=True), 'id': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UISampleViewVideoControlsModel(*, id: str, components: list[mxcubeweb.core.models.configmodels._UISampleViewVideoGridSettingsModel | mxcubeweb.core.models.configmodels._UISampleViewVideoControlsModel])[source]#

Bases: UIPropertiesModel

Parameters:
  • id (str) –

  • components (list[mxcubeweb.core.models.configmodels._UISampleViewVideoGridSettingsModel | mxcubeweb.core.models.configmodels._UISampleViewVideoControlsModel]) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'components': FieldInfo(annotation=list[Union[_UISampleViewVideoGridSettingsModel, _UISampleViewVideoControlsModel]], required=True), 'id': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UISessionPickerModel(*, id: Literal['session_picker'] = 'session_picker', tabs: UiSessionPickerTabs = UiSessionPickerTabs(active=True, scheduled=True, other_beamlines=True, all_sessions=False))[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'id': FieldInfo(annotation=Literal['session_picker'], required=False, default='session_picker'), 'tabs': FieldInfo(annotation=UiSessionPickerTabs, required=False, default=UiSessionPickerTabs(active=True, scheduled=True, other_beamlines=True, all_sessions=False))}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UiSessionPickerTabs(*, active: bool = True, scheduled: bool = True, other_beamlines: bool = True, all_sessions: bool = False)[source]#

Bases: BaseModel

Parameters:
  • active (bool) –

  • scheduled (bool) –

  • other_beamlines (bool) –

  • all_sessions (bool) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'active': FieldInfo(annotation=bool, required=False, default=True), 'all_sessions': FieldInfo(annotation=bool, required=False, default=False), 'other_beamlines': FieldInfo(annotation=bool, required=False, default=True), 'scheduled': FieldInfo(annotation=bool, required=False, default=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UserManagerConfigModel(*, class_name: str = 'UserManager', inhouse_is_staff: bool = True, users: list[mxcubeweb.core.models.configmodels.UserManagerUserConfigModel])[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'class_name': FieldInfo(annotation=str, required=False, default='UserManager', alias='class', alias_priority=2, description='UserManager class'), 'inhouse_is_staff': FieldInfo(annotation=bool, required=False, default=True, description='Treat users defined as inhouse in session.xml as staff'), 'users': FieldInfo(annotation=list[UserManagerUserConfigModel], required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.models.configmodels.UserManagerUserConfigModel(*, username: str = '', role: str = 'staff')[source]#

Bases: BaseModel

Parameters:
  • username (str) –

  • role (str) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'role': FieldInfo(annotation=str, required=False, default='staff', description='Role to give user'), 'username': FieldInfo(annotation=str, required=False, default='', description='username')}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.