Task¶
Bases: Task_
Source code in src/plankapy/interfaces.py
2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 |
|
delete()
¶
Deletes the task
Danger
This action is irreversible and cannot be undone
Returns:
Name | Type | Description |
---|---|---|
Task |
Task
|
Deleted task instance |
Source code in src/plankapy/interfaces.py
2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 |
|
refresh()
¶
Refreshes the task data
Source code in src/plankapy/interfaces.py
2654 2655 2656 2657 2658 2659 |
|
update(*args, **kwargs)
¶
update()
update(task: Task)
update(name: str = None, isCompleted: bool = None) -> Task
Updates the task with new values
Tip
If you want to update a task, it's better to use the editor()
context manager
Example:
>>> with task.editor():
... task.name = 'New Task Name'
... task.isCompleted = True
>>> task
Task(id=1, name='New Task Name', isCompleted=True, ...)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the task (optional) |
required |
isCompleted
|
bool
|
Whether the task is completed (optional) |
required |
Alternate
Name | Type | Description | Default |
---|---|---|---|
task
|
Task
|
Task instance to update (required) |
required |
Note
If no arguments are provided, the task will update itself with the current values stored in its attributes
Returns:
Name | Type | Description |
---|---|---|
Task |
Task
|
Updated task instance |
Source code in src/plankapy/interfaces.py
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 |
|