Unit
Unit - Data management in dynamic fields.
Unit
¶
Unit of information for choices parameter in dynamic field types.
Source code in src/ramifice/unit.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
__init__(field, title, value, is_delete=False)
¶
Unit of information for choices parameter in dynamic field types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str
|
The name of the dynamic field. |
required |
title
|
dict[str, str]
|
The name of the choice item. Example: {"en": "Title", "ru": "Заголовок"}. |
required |
value
|
float | int | str
|
The value of the choice item. |
required |
is_delete
|
bool
|
True - if you need to remove the item of choice. |
False
|
Source code in src/ramifice/unit.py
check_empty_arguments()
¶
Check the arguments (field|title|value) for empty values.
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/ramifice/unit.py
from_dict(unit_dict)
classmethod
¶
from_json(json_str)
classmethod
¶
to_dict()
¶
Convert Unit instance to a dictionary.