Task List¶
| CLASS | DESCRIPTION |
|---|---|
TaskList |
Python interface for Planka TaskLists |
TaskList
¶
TaskList(schema: Schema, session: Planka)
Bases: PlankaModel[TaskList]
Python interface for Planka TaskLists
- Plankapy v2 models
-
Plankapy v2
models
Card
Cardadd_task_list
| METHOD | DESCRIPTION |
|---|---|
add_task |
Create a new Task in the TaskList |
copy |
Create a deepcopy of the model and its associated schema. |
delete |
Delete the TaskList |
diff |
Get a schema diff between two model schemas. |
positon |
Set the TaskList position within the Card |
sync |
Sync the TaskList with the Planka server |
update |
Update the TaskList |
| ATTRIBUTE | DESCRIPTION |
|---|---|
__formatter__ |
Formatter func that allows overriding str behavior for models
TYPE:
|
card |
The Card the TaskList belongs to
TYPE:
|
created_at |
When the TaskList was created
TYPE:
|
hide_completed_tasks |
Whether to hide completed Tasks
TYPE:
|
name |
Name/title of the TaskList
TYPE:
|
position |
Position of the TaskList within the Card
TYPE:
|
show_on_front_of_card |
Whether to show the TaskList on the front of the Card
TYPE:
|
tasks |
All Tasks associated with the TaskList |
updated_at |
When the TaskList 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
show_on_front_of_card
property
writable
¶
show_on_front_of_card: bool
Whether to show the TaskList on the front of the Card
add_task
¶
add_task(name: str, *, is_completed: bool = False, position: Position = 'top', linked_card: Card | None = None) -> Task
Create a new Task in the TaskList
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the task
TYPE:
|
|
Is the task completed or not (default:
TYPE:
|
|
Position of the task in the TaskList (default:
TYPE:
|
|
Optional Card to link the Task to (default:
TYPE:
|
Source code in src/plankapy/v2/models/task_list.py
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 | |
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 TaskList
Source code in src/plankapy/v2/models/task_list.py
96 97 98 | |
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 | |
positon
¶
positon(position: int) -> None
Set the TaskList position within the Card
Source code in src/plankapy/v2/models/task_list.py
46 47 48 49 | |
sync
¶
sync()
Sync the TaskList with the Planka server
Source code in src/plankapy/v2/models/task_list.py
88 89 90 | |
update
¶
update(**kwargs: Unpack[Request_updateTaskList])
Update the TaskList
Source code in src/plankapy/v2/models/task_list.py
92 93 94 | |