Form
Forms class for “form:form” tag.
Classes:
| Name | Description |
|---|---|
Form |
Specification a user-interface form and defines the contents and |
FormMixin |
Mixin class for classes containing Form. |
Form
Bases: FormMixin, OfficeTargetFrameMixin
Specification a user-interface form and defines the contents and properties of the form, “form:form”.
The “form:form” element is usable within the following elements: “form:form” and “office:forms”.
(The main objective of the current minimal implementation is to parse the existing form in a document.)
Methods:
| Name | Description |
|---|---|
__init__ |
Create a Form, “form:form”. |
__repr__ |
|
Attributes:
| Name | Type | Description |
|---|---|---|
apply_filter |
|
|
command |
|
|
command_type |
|
|
control_implementation |
|
|
datasource |
|
|
name |
|
|
target_frame |
|
Source code in odfdo/form.py
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 128 129 130 131 132 | |
_properties
class-attribute
instance-attribute
_properties = (
PropDef("name", "form:name"),
PropDef("command", "form:command"),
PropDef("datasource", "form:datasource"),
PropDef("apply_filter", "form:apply-filter"),
PropDef("command_type", "form:command-type"),
PropDef(
"control_implementation",
"form:control-implementation",
),
)
_tag
class-attribute
instance-attribute
_tag = 'form:form'
apply_filter
instance-attribute
apply_filter = apply_filter
command
instance-attribute
command = command
command_type
instance-attribute
command_type = command_type
control_implementation
instance-attribute
control_implementation = control_implementation
datasource
instance-attribute
datasource = datasource
name
instance-attribute
name = name
target_frame
instance-attribute
target_frame = target_frame
__init__
__init__(
name: str | None = "Form",
command: str | None = None,
datasource: str | None = None,
apply_filter: bool | None = None,
command_type: str | None = None,
control_implementation: str | None = None,
target_frame: str | None = None,
**kwargs: Any,
) -> None
Create a Form, “form:form”.
The “form:form” element is usable within the following elements: “form:form” and “office:forms”.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the form. |
'Form'
|
command
|
str | None
|
The command for the form. |
None
|
datasource
|
str | None
|
The data source for the form. |
None
|
apply_filter
|
bool | None
|
If True, a filter is applied. |
None
|
command_type
|
str | None
|
The type of the command. |
None
|
control_implementation
|
str | None
|
The control implementation. |
None
|
target_frame
|
str | None
|
The target frame for the form. |
None
|
kwargs
|
Any
|
Arbitrary keyword arguments for the Element base class. |
{}
|
Source code in odfdo/form.py
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 128 129 | |
__repr__
__repr__() -> str
Source code in odfdo/form.py
131 132 | |
FormMixin
Bases: Element
Mixin class for classes containing Form.
Used by the following classes: “form:form”, “office:forms”. And also in “office:text”, “table:table” for ease of use.
Methods:
| Name | Description |
|---|---|
get_forms |
Return all the Form that match the criteria. |
Attributes:
| Name | Type | Description |
|---|---|---|
forms |
list[Form]
|
Return all the Form elements.. |
Source code in odfdo/form.py
30 31 32 33 34 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 | |
forms
property
forms: list[Form]
get_forms
get_forms(name: str | None = None) -> list[Form]
Return all the Form that match the criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the form to filter by. |
None
|
Returns:
| Type | Description |
|---|---|
list[Form]
|
list[Form]: A list of Form instances matching the criteria. |
Source code in odfdo/form.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |