Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ImmutableDomain

A read-only view of a domain. Returned by entity.entityClass.domain — the domain reached through an entity's class reference. Exposes all Domain fields as read-only and has no mutation methods; attempting to call a setter raises an AttributeError.

ImmutableDomain is the superclass of Domain. Instances obtained from document-level paths (e.g. document.getDomainByName(name)) are full Domain objects and support mutation. Instances obtained through entity.entityClass.domain are ImmutableDomain and do not.

To modify a domain, look it up from the document rather than from an entity:

name = entity.entityClass.domain.name    # read the name (fine via immutable ref)
dom = document.getDomainByName(name)
dom.setName("Renamed")                   # modify via mutable Domain

Fields

All fields are read-only on ImmutableDomain.

FieldTypeDescription
namestringThe domain's name.
uuidstringRead-only. A unique identifier for this domain.
builtInbooleanRead-only. True if the domain is built-in and cannot be modified.
hiddenbooleanRead-only. True if the domain is hidden from the domain panel.
entityClasseslist of ImmutableEntityClassRead-only. Entity classes in the domain, as read-only references.

Methods

getEntityClassByName( name )

Returns the entity class in the domain with the given name, as an ImmutableEntityClass. Returns None if no such class exists.