Project Task¶
-
class
moco_wrapper.models.
ProjectTask
(moco)¶ Class for handling tasks of a project.
-
create
(project_id: int, name: str, billable: bool = True, active: bool = True, budget: float = None, hourly_rate: float = None)¶ Create a task for a project.
Parameters: - project_id – Id of the project the created task will belong to
- name – Name of the task
- billable – If this expense billable (default True)
- active – If this expense active (default True)
- budget – Budget for the task (e.g. 200.75)
- hourly_rate – How much is the hourly rate for the task (e.g.: 120.5)
Returns: The created project task
-
delete
(project_id: int, task_id: int)¶ Delete project task
Parameters: - project_id – Id of the project the task belongs to
- task_id – Id of the task to delete
Returns: Empty response on success
Note
Deletion of a task is only possible as long as no hours were tracked for the task
-
get
(project_id: int, task_id: int)¶ Retrieve a single project task.
Parameters: project_id – Id of the project the task belongs to :param task:id: Id of the task :returns: Single project task
-
getlist
(project_id: int, sort_by: str = None, sort_order: str = 'asc', page: int = 1)¶ Retrieve a list of tasks for a project.
Parameters: - project_id – Id of the project
- sort_by – Field to sort results by
- sort_order – asc or desc (default asc)
- page – Page number (default 1)
Returns: List of project tasks
-
update
(project_id: int, task_id: int, name: str = None, billable: bool = None, active: bool = None, budget: float = None, hourly_rate: float = None)¶ Update a task for a project.
Parameters: - project_id – Id of the project the task belongs to
- task_id – Id of the task to update
- name – Name of the task
- billable – If this expense billable (default True)
- active – If this expense active (default True)
- budget – Budget for the task (e.g. 200.75)
- hourly_rate – How much is the hourly rate for the task (e.g.: 120.5)
Returns: The updated project task
-