Form Controls Mixins
Mixin classes for Form controls.
(The main objective of the current minimal implementation of forms is to parse the existing form contents in a document.)
Classes:
| Name | Description |
|---|---|
FormAsDictMixin |
Mixin for the as_dict() method of Form Control classes. |
FormButtonTypeMixin |
Mixin for the “form:button-type” attribute. |
FormDelayRepeatMixin |
Mixin for the “form:delay-for-repeat” attribute. |
FormImageAlignMixin |
Mixin for the “form:image-align” attribute. |
FormImagePositionMixin |
Mixin for the “form:image-position” attribute. |
FormMaxLengthMixin |
Mixin for the “form:max-length” attribute. |
FormSizetMixin |
Mixin for the “form:size” attribute. |
FormSourceListMixin |
Mixin for the “form:list-source-type” attribute. |
OfficeTargetFrameMixin |
Mixin for the “office:target-frame” attribute. |
FormAsDictMixin
Mixin for the as_dict() method of Form Control classes.
Methods:
| Name | Description |
|---|---|
as_dict |
Serialize the Form content as a Python dict. |
Source code in odfdo/form_controls_mixins.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
as_dict
as_dict() -> dict[str, str | Decimal | int | None]
Serialize the Form content as a Python dict.
Returns:
| Type | Description |
|---|---|
dict[str, str | Decimal | int | None]
|
The Form content as a Python dict. |
Source code in odfdo/form_controls_mixins.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
FormButtonTypeMixin
Bases: Element
Mixin for the “form:button-type” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
BUTTON_TYPES |
set[str]
|
|
button_type |
str | None
|
|
Source code in odfdo/form_controls_mixins.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
BUTTON_TYPES
class-attribute
BUTTON_TYPES: set[str] = {'submit', 'reset', 'push', 'url'}
button_type
property
writable
button_type: str | None
FormDelayRepeatMixin
Bases: Element
Mixin for the “form:delay-for-repeat” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
delay_for_repeat |
str
|
|
Source code in odfdo/form_controls_mixins.py
33 34 35 36 37 38 39 40 41 42 43 44 | |
delay_for_repeat
property
writable
delay_for_repeat: str
FormImageAlignMixin
Bases: Element
Mixin for the “form:image-align” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
IMAGE_ALIGN |
set[str]
|
|
image_align |
str | None
|
|
Source code in odfdo/form_controls_mixins.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
IMAGE_ALIGN
class-attribute
IMAGE_ALIGN: set[str] = {'start', 'center', 'end'}
image_align
property
writable
image_align: str | None
FormImagePositionMixin
Bases: Element
Mixin for the “form:image-position” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
IMAGE_POSITION |
set[str]
|
|
image_position |
str | None
|
|
Source code in odfdo/form_controls_mixins.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
IMAGE_POSITION
class-attribute
IMAGE_POSITION: set[str] = {
"bottom",
"center",
"end",
"start",
"top",
}
image_position
property
writable
image_position: str | None
FormMaxLengthMixin
Bases: Element
Mixin for the “form:max-length” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
max_length |
int | None
|
|
Source code in odfdo/form_controls_mixins.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
max_length
property
writable
max_length: int | None
FormSizetMixin
Bases: Element
Mixin for the “form:size” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
size |
int | None
|
|
Source code in odfdo/form_controls_mixins.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
size
property
writable
size: int | None
FormSourceListMixin
Bases: Element
Mixin for the “form:list-source-type” attribute.
Attributes:
| Name | Type | Description |
|---|---|---|
LIST_SOURCE_TYPE |
set[str]
|
|
list_source_type |
str | None
|
|
Source code in odfdo/form_controls_mixins.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
LIST_SOURCE_TYPE
class-attribute
LIST_SOURCE_TYPE: set[str] = {
"table",
"query",
"sql",
"sql-pass-through",
"value-list",
"table-fields",
}
list_source_type
property
writable
list_source_type: str | None
OfficeTargetFrameMixin
Bases: Element
Mixin for the “office:target-frame” attribute.
Usable with the following elements: “form:button”, “form:form” and “form:imag”.
Attributes:
| Name | Type | Description |
|---|---|---|
TARGET_FRAME |
set[str]
|
|
target_frame |
str | None
|
|
Source code in odfdo/form_controls_mixins.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
TARGET_FRAME
class-attribute
TARGET_FRAME: set[str] = {
"_blank",
"_parent",
"_self",
"_top",
}
target_frame
property
writable
target_frame: str | None