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.
| Field | Type | Description |
|---|---|---|
name | string | The domain's name. |
uuid | string | Read-only. A unique identifier for this domain. |
builtIn | boolean | Read-only. True if the domain is built-in and cannot be modified. |
hidden | boolean | Read-only. True if the domain is hidden from the domain panel. |
entityClasses | list of ImmutableEntityClass | Read-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
Noneif no such class exists.