Module the_dictionary_partial
- class ooodev.utils.partial.the_dictionary_partial.TheDict(values=None)[source]
A partial class for implementing dictionary values
- Parameters:
values (Dict[str, Any] | None) –
- get(key, default=<ooodev.utils.gen_util._null_obj object>)[source]
Gets user data from event.
- Parameters:
key (str) – Key used to store data
default (Any, optional) – Default value to return if
keyis not found.
- Returns:
Data for
keyif found; Otherwise, ifdefaultis set thendefault.- Return type:
Any
- Raises:
KeyError – If
keyis not found anddefaultis not set.
- has(key)[source]
Gets if a key exist in the instance
- Parameters:
key (str) – key
- Returns:
Trueif key exist; OtherwiseFalse- Return type:
bool
- remove(key)[source]
Removes key value pair from instance
- Parameters:
key (str) – key
- Returns:
Trueif key was found and removed; Otherwise,False- Return type:
bool
- set(key, value, allow_overwrite=True)[source]
Sets a key value pair for event instance.
- Parameters:
key (str) – Key
value (Any) – Value
allow_overwrite (bool, optional) – If
Trueand akeyalready exist then itsvaluewill be over written; Otherwisevaluewill not be over written. Defaults toTrue.
- Returns:
Trueif values is written; Otherwise,False- Return type:
bool
- class ooodev.utils.partial.the_dictionary_partial.TheDictionaryPartial(values=None)[source]
A partial class for implementing dictionary values
- Parameters:
values (Dict[str, Any] | None) –
- __init__(values=None)[source]
Constructor
- Parameters:
values (Dict[str, Any] | None, optional) – Dictionary Values. Defaults to None.
- Return type:
None
- property extra_data: TheDict
Extra Data Key Value Pair Dictionary.
Properties can be assigned properties and access like a dictionary and with dot notation.
Note
This is a dictionary object that can be used to store key value pairs. Generally speaking this data is not part of the object’s main data structure and is not saved with the object (document).
This property is used to store data that is not part of the object’s main data structure and can be used however the developer sees fit.
- Return type: