Custom Field Group¶
| CLASS | DESCRIPTION |
|---|---|
CustomFieldGroup |
Python interface for Planka CustomFieldGroups |
CustomFieldGroup
¶
CustomFieldGroup(schema: Schema, session: Planka)
Bases: PlankaModel[CustomFieldGroup]
Python interface for Planka CustomFieldGroups
| METHOD | DESCRIPTION |
|---|---|
add_field |
Add a Field to the CustomFieldGroup |
add_fields |
Add fields to the CustomFieldGroup |
add_to_card |
Add the CustomFieldGroup to a Card |
copy |
Create a deepcopy of the model and its associated schema. |
delete |
Delete the CustomFieldGroup |
diff |
Get a schema diff between two model schemas. |
make_base_group |
Convert a CustomFieldGroup into a BaseCustomFieldGroup for a Project or Board |
remove_field |
Remove the field from the CustomFieldGroup |
sync |
Sync the CustomFieldGroup with the Planka server |
update |
Update the CustomFieldGroup |
| ATTRIBUTE | DESCRIPTION |
|---|---|
__formatter__ |
Formatter func that allows overriding str behavior for models
TYPE:
|
base_custom_field_group |
The BaseCustomFieldGroup used as a template
TYPE:
|
board |
The Board the CustomFieldGroup belongs to
TYPE:
|
card |
The Card the CustomFieldGroup belongs to
TYPE:
|
created_at |
When the CustomFieldGroup was created
TYPE:
|
name |
Name/title of the CustomFieldGroup
TYPE:
|
position |
Position of the CustomFieldGroup within the Board/Card
TYPE:
|
updated_at |
When the CustomFieldGroup was last updated
TYPE:
|
Source code in src/plankapy/v2/models/_base.py
30 31 32 33 34 35 36 | |
__formatter__
class-attribute
instance-attribute
¶
__formatter__: ModelFormatter[Self] = DEFAULT_FORMATTER
Formatter func that allows overriding str behavior for models
base_custom_field_group
property
¶
base_custom_field_group: BaseCustomFieldGroup
The BaseCustomFieldGroup used as a template
add_field
¶
add_field(name: str, *, position: Position = 'top', show_on_card: bool = False) -> CustomField
Add a Field to the CustomFieldGroup
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the Field to add
TYPE:
|
|
The position of the field within the group (default:
TYPE:
|
|
Show the field on the Card front (default:
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CustomField
|
If the Field aleady exists, that Field is returned
TYPE:
|
Source code in src/plankapy/v2/models/custom_field_group.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
add_fields
¶
add_fields(*names: str, position: Position = 'top', show_on_card: bool = False) -> list[CustomField]
Add fields to the CustomFieldGroup
| PARAMETER | DESCRIPTION |
|---|---|
|
Varargs of the names to add
TYPE:
|
|
The position of the field within the group (default:
TYPE:
|
|
Show the field on the Card front (default:
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[CustomField]
|
list[CustomField] : The fields added |
Note
Field positions will be calculated in the order passed
Source code in src/plankapy/v2/models/custom_field_group.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
add_to_card
¶
add_to_card(card: Card) -> CustomFieldGroup
Add the CustomFieldGroup to a Card
| PARAMETER | DESCRIPTION |
|---|---|
|
The Card to add the CustomFieldGroup to
TYPE:
|
Source code in src/plankapy/v2/models/custom_field_group.py
98 99 100 101 102 103 104 105 106 107 | |
copy
¶
copy() -> Self
Create a deepcopy of the model and its associated schema.
Note
Since the endpoints for both instances of the Model are the same, any calls to update will restore the state and bring both copies into sync. copies like this are meant more for comparing changes when running a sync or update/assignemnt operation.
Example:
>>> card_copy = card.copy()
>>> card.name = 'Updated Name'
>>> card_copy.name
'Original Name'
>>> card.name
'Updated Name'
>>> # This update may have had side effects
>>> print(card_copy.diff(card))
{'name': ('Original Name', 'Updated Name'), 'updatedAt': ('...2:00pm', '...2:45pm'), ...}
Source code in src/plankapy/v2/models/_base.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
delete
¶
delete()
Delete the CustomFieldGroup
Source code in src/plankapy/v2/models/custom_field_group.py
94 95 96 | |
diff
¶
diff(other: PlankaModel[Schema]) -> Diff
Get a schema diff between two model schemas.
Note
Only matching keys are diffed. Any schema keys that are not in the source schema will not be checked in the target schema
Source code in src/plankapy/v2/models/_base.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
make_base_group
¶
make_base_group(project: Project) -> BaseCustomFieldGroup
Convert a CustomFieldGroup into a BaseCustomFieldGroup for a Project or Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The project to add the BaseCustomFieldGroup to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
BaseCustomFieldGroup
|
The new BaseCustomFieldGroup
TYPE:
|
Source code in src/plankapy/v2/models/custom_field_group.py
109 110 111 112 113 114 115 116 117 118 | |
remove_field
¶
remove_field(field: CustomField) -> None
Remove the field from the CustomFieldGroup
| PARAMETER | DESCRIPTION |
|---|---|
|
The CustomField to remove (must be in this Group)
TYPE:
|
Source code in src/plankapy/v2/models/custom_field_group.py
170 171 172 173 174 175 176 177 | |
sync
¶
sync()
Sync the CustomFieldGroup with the Planka server
Source code in src/plankapy/v2/models/custom_field_group.py
86 87 88 | |
update
¶
update(**kwargs: Unpack[Request_updateCustomFieldGroup])
Update the CustomFieldGroup
Source code in src/plankapy/v2/models/custom_field_group.py
90 91 92 | |