Skip to content

Collections

Collection

Bases: Entry, HasOwner, HasBlocks

Attributes:

Name Type Description
blocks_obj dict[str, DataBlockResponse]

A mapping from block ID to block data.

collection_id HumanReadableIdentifier

A short human-readable/usable name for the collection.

creator_ids list[PyObjectId]

The database IDs of the user(s) who created the item.

creators list[Person] | None

Inlined info for the people associated with this item.

description str | None

A description of the collection, either in plain-text or a markup language.

display_order list[str]

The order in which to display block data in the UI.

immutable_id PyObjectId

The immutable database ID of the entry.

last_modified IsoformatDateTime | None

The timestamp at which the entry was last modified.

num_items int | None

Inlined number of items associated with this collection.

relationships list[TypedRelationship] | None

A list of related entries and their types.

title str | None

A descriptive title for the collection.

type str

The resource type of the entry.

blocks_obj

blocks_obj: dict[str, DataBlockResponse] = Field({})

A mapping from block ID to block data.

collection_id

collection_id: HumanReadableIdentifier = Field(None)

A short human-readable/usable name for the collection.

creator_ids

creator_ids: list[PyObjectId] = Field([])

The database IDs of the user(s) who created the item.

creators

creators: list[Person] | None = Field(None)

Inlined info for the people associated with this item.

description

description: str | None

A description of the collection, either in plain-text or a markup language.

display_order

display_order: list[str] = Field([])

The order in which to display block data in the UI.

immutable_id

immutable_id: PyObjectId = Field(None, title='Immutable ID', alias='_id', format='uuid')

The immutable database ID of the entry.

last_modified

last_modified: IsoformatDateTime | None = None

The timestamp at which the entry was last modified.

num_items

num_items: int | None = Field(None)

Inlined number of items associated with this collection.

relationships

relationships: list[TypedRelationship] | None = None

A list of related entries and their types.

title

title: str | None

A descriptive title for the collection.

type

type: str = Field('collections', const='collections', pattern='^collections$')

The resource type of the entry.

check_id_names

check_id_names(values)

Slightly upsetting hack: this case should be covered by the pydantic setting for populating fields by alias names.

check_ids

check_ids(values)

to_reference

to_reference(additional_fields: list[str] | None = None) -> EntryReference

Populate an EntryReference model from this entry, selecting additional fields to inline.

Parameters:

Name Type Description Default
additional_fields list[str] | None

A list of fields to inline in the reference.

None