Attachment¶
- class dsviper.Attachment¶
Bases:
objectThe declaration binding a concept to a value type.
From it, keys are minted and documents created. It holds no document: a store does, and AttachmentGetting reads one by attachment and key.
Note: Not directly instantiable.
- create_key(instance_id: ValueUUId | None = None) ValueKey¶
Return a key for this attachment, naming the instance instance_id, or a fresh instance when it is None.
- create_structure(initial_value: dict[str, _InputValues] | None = None) ValueStructure¶
Return a new document of this attachment’s document type.
initial_value fills it in; raise if it does not fit the type.
- description(*, namespace: NameSpace | None = None) str¶
Return the attachment rendered for display.
With namespace, every name is written relative to it. Without, the key and document types are written relative to the attachment’s own namespace, and the attachment’s name in full.
- documentation() str¶
Return the documentation the attachment was created with, empty when none was given.
- identifier() str¶
Return the identifier, the key type and the name joined by a dot.
App::User.profile, for an attachment named profile on a concept User of namespace App. That is key_type().representation(); type_key().representation() answers the same question with key<App::User>, which is not what goes here.
- key_type() _AbstractionTypes¶
Return the type of the key.
- optional_document_type() TypeOptional¶
Return the type of the optional document.
- representation(*, namespace: NameSpace | None = None) str¶
Return the declaration as text, qualified against namespace when one is given.