Ledger
- class app.portfolio.models.ledger.ledger.Ledger[source]
Bases:
EmptyClass,NamedInstanceStoreMixin,Entity[LedgerRecord, LedgerJournal]
Inheritance Diagram for Ledger
Methods
by_instrument(instrument)Return the ledger instance associated with the given instrument.
calculate_instance_name_from_dict(data[, ...])Convert the provided keyword arguments to an instance name.
model_post_init(context)Attributes
Configuration for the model, should be a dictionary conforming to
ConfigDict.instance_nameuidentity_logentity_dependentsinstance_parent_weakref- classmethod by_instrument(instrument: __annotationlib_name_1__ | Uid) Self | None[source]
Return the ledger instance associated with the given instrument.
If no ledger exists for the instrument, returns None.
- classmethod calculate_instance_name_from_dict(data: Mapping[str, Any], allow_missing_instrument: bool = False) str[source]
Convert the provided keyword arguments to an instance name.
This method should be implemented by subclasses to define how to derive the instance name.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'serialize_by_alias': True, 'validate_assignment': True, 'validate_by_alias': True}
Configuration for the model, should be a dictionary conforming to
ConfigDict.