Base Custom Field Group¶
| CLASS | DESCRIPTION |
|---|---|
BaseCustomFieldGroup |
Python interface for Planka BaseCustomFieldGroups |
BaseCustomFieldGroup
¶
BaseCustomFieldGroup(schema: Schema, session: Planka)
Bases: PlankaModel[BaseCustomFieldGroup]
Python interface for Planka BaseCustomFieldGroups
- Plankapy v2 models
-
Plankapy v2
models
Board
Boardcreate_field_group
| METHOD | DESCRIPTION |
|---|---|
add_field |
Add an existing CustomField to the BaseGroup |
add_fields |
Add a multiple CustomFields to the field group. Useful for copying from one |
copy |
Create a deepcopy of the model and its associated schema. |
create_field |
Create a new CustomField in the BaseCustomFieldGroup |
create_fields |
Create multiple fields in the group (position will be arg order) |
delete |
Delete the BaseCustomFieldGroup |
delete_field |
Delete a CustomField from the Group |
delete_fields |
Delete s sequence of fields from the Group |
diff |
Get a schema diff between two model schemas. |
sync |
Sync the BaseCustomFieldGroup with the Planka server |
update |
Update the BaseCustomFieldGroup |
| ATTRIBUTE | DESCRIPTION |
|---|---|
__formatter__ |
Formatter func that allows overriding str behavior for models
TYPE:
|
created_at |
When the base custom field group was created
TYPE:
|
custom_fields |
The CustomFields associated with the BaseCustomFieldGroup
TYPE:
|
name |
Name/title of the base custom field group
TYPE:
|
project |
The Project that the BaseCustomFieldGroup is associated with
TYPE:
|
updated_at |
When the base custom field group 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
custom_fields
property
¶
custom_fields: list[CustomField]
The CustomFields associated with the BaseCustomFieldGroup
add_field
¶
add_field(field: CustomField, *, position: Position = 'top', show_on_card: bool | None = None) -> CustomField
Add an existing CustomField to the BaseGroup
| PARAMETER | DESCRIPTION |
|---|---|
|
The existing CustomField to add
TYPE:
|
|
The position of the new Field
TYPE:
|
|
Override the input Field's show state
TYPE:
|
Note
If a CustomField with a matching name already exists in the base group, it will be returned
Source code in src/plankapy/v2/models/base_custom_field_group.py
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 | |
add_fields
¶
add_fields(fields: Sequence[CustomField], *, position: Position = 'top', show_on_card: bool | None = None) -> list[CustomField]
Add a multiple CustomFields to the field group. Useful for copying from one Project to another
| PARAMETER | DESCRIPTION |
|---|---|
|
A sequence of fields to add
TYPE:
|
|
Position override for the fields (Will be applied sequence in order)
TYPE:
|
|
Card display override for fields
TYPE:
|
Example
>>> p1_bcfg.add_fields(p2_bcfg.custom_fields)
Source code in src/plankapy/v2/models/base_custom_field_group.py
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 | |
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 | |
create_field
¶
create_field(name: str, *, position: Position = 'top', show_on_card: bool = False) -> CustomField
Create a new CustomField in the BaseCustomFieldGroup
| PARAMETER | DESCRIPTION |
|---|---|
|
Name/title of the custom field
TYPE:
|
|
Position of the custom field within the group
TYPE:
|
|
Whether to show the field on the front of cards
TYPE:
|
Source code in src/plankapy/v2/models/base_custom_field_group.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
create_fields
¶
create_fields(*names: str, show_on_card: bool = False) -> list[CustomField]
Create multiple fields in the group (position will be arg order)
| PARAMETER | DESCRIPTION |
|---|---|
|
Varargs of the new field names
TYPE:
|
|
Show the new fields on the front of Cards
TYPE:
|
Source code in src/plankapy/v2/models/base_custom_field_group.py
146 147 148 149 150 151 152 153 154 155 156 157 | |
delete
¶
delete()
Delete the BaseCustomFieldGroup
Source code in src/plankapy/v2/models/base_custom_field_group.py
66 67 68 | |
delete_field
¶
delete_field(field: CustomField) -> CustomField | None
Delete a CustomField from the Group
| PARAMETER | DESCRIPTION |
|---|---|
|
The field to delete
TYPE:
|
Note
If the field is not a member of the group, None will be returned
Source code in src/plankapy/v2/models/base_custom_field_group.py
159 160 161 162 163 164 165 166 167 168 169 170 | |
delete_fields
¶
delete_fields(fields: Sequence[CustomField]) -> list[CustomField]
Delete s sequence of fields from the Group
| PARAMETER | DESCRIPTION |
|---|---|
|
The fields to delete
TYPE:
|
Note
If the field is not a member of the group, it will not be included in the returned list
Source code in src/plankapy/v2/models/base_custom_field_group.py
172 173 174 175 176 177 178 179 180 181 182 183 | |
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 | |
sync
¶
sync()
Sync the BaseCustomFieldGroup with the Planka server
Source code in src/plankapy/v2/models/base_custom_field_group.py
56 57 58 59 60 | |
update
¶
update(**base_custom_field_group: Unpack[Request_updateBaseCustomFieldGroup])
Update the BaseCustomFieldGroup
Source code in src/plankapy/v2/models/base_custom_field_group.py
62 63 64 | |