projectal.entities.project
1from projectal.entity import Entity 2from projectal.linkers import * 3from projectal import api 4 5 6class Project( 7 Entity, 8 LocationLinker, 9 CustomerLinker, 10 FileLinker, 11 StageLinker, 12 RebateLinker, 13 StageListLinker, 14 CompanyLinker, 15 NoteLinker, 16 TagLinker, 17 TaskInProjectLinker, 18 TimelogLinker, 19): 20 """ 21 Implementation of the [Project](https://projectal.com/docs/latest/#tag/Project) API. 22 """ 23 24 _path = "project" 25 _name = "project" 26 _links = [ 27 LocationLinker, 28 CustomerLinker, 29 FileLinker, 30 StageLinker, 31 RebateLinker, 32 StageListLinker, 33 NoteLinker, 34 TagLinker, 35 TaskInProjectLinker, 36 TimelogLinker, 37 ] 38 _links_reverse = [CompanyLinker] 39 40 @classmethod 41 def stage_order(cls, uuId, stages): 42 """Reorder the Project's Stage links in a customer order.""" 43 url = "/api/project/stage_list/order?holder={}".format(uuId) 44 api.post(url, stages) 45 return True 46 47 @classmethod 48 def autoschedule(cls, project, mode="ASAP"): 49 """ 50 Autoschedule the project. 51 52 `project`: A Project entity 53 54 `mode`: `ASAP` or `ALAP` 55 """ 56 url = "/api/project/schedule?mode={}".format(mode) 57 api.post(url, [project]) 58 return True 59 60 def tasks(self): 61 """Get a list of uuIds of all tasks in this Project.""" 62 payload = { 63 "name": "Task in project", 64 "type": "msql", 65 "start": 0, 66 "limit": -1, 67 "holder": "{}".format(self["uuId"]), 68 "select": [["PROJECT.TASK.uuId"]], 69 } 70 return [t[0] for t in api.query(payload)]
class
Project(projectal.entity.Entity, projectal.linkers.LocationLinker, projectal.linkers.CustomerLinker, projectal.linkers.FileLinker, projectal.linkers.StageLinker, projectal.linkers.RebateLinker, projectal.linkers.StageListLinker, projectal.linkers.CompanyLinker, projectal.linkers.NoteLinker, projectal.linkers.TagLinker, projectal.linkers.TaskInProjectLinker, projectal.linkers.TimelogLinker):
7class Project( 8 Entity, 9 LocationLinker, 10 CustomerLinker, 11 FileLinker, 12 StageLinker, 13 RebateLinker, 14 StageListLinker, 15 CompanyLinker, 16 NoteLinker, 17 TagLinker, 18 TaskInProjectLinker, 19 TimelogLinker, 20): 21 """ 22 Implementation of the [Project](https://projectal.com/docs/latest/#tag/Project) API. 23 """ 24 25 _path = "project" 26 _name = "project" 27 _links = [ 28 LocationLinker, 29 CustomerLinker, 30 FileLinker, 31 StageLinker, 32 RebateLinker, 33 StageListLinker, 34 NoteLinker, 35 TagLinker, 36 TaskInProjectLinker, 37 TimelogLinker, 38 ] 39 _links_reverse = [CompanyLinker] 40 41 @classmethod 42 def stage_order(cls, uuId, stages): 43 """Reorder the Project's Stage links in a customer order.""" 44 url = "/api/project/stage_list/order?holder={}".format(uuId) 45 api.post(url, stages) 46 return True 47 48 @classmethod 49 def autoschedule(cls, project, mode="ASAP"): 50 """ 51 Autoschedule the project. 52 53 `project`: A Project entity 54 55 `mode`: `ASAP` or `ALAP` 56 """ 57 url = "/api/project/schedule?mode={}".format(mode) 58 api.post(url, [project]) 59 return True 60 61 def tasks(self): 62 """Get a list of uuIds of all tasks in this Project.""" 63 payload = { 64 "name": "Task in project", 65 "type": "msql", 66 "start": 0, 67 "limit": -1, 68 "holder": "{}".format(self["uuId"]), 69 "select": [["PROJECT.TASK.uuId"]], 70 } 71 return [t[0] for t in api.query(payload)]
Implementation of the Project API.
@classmethod
def
stage_order(cls, uuId, stages):
41 @classmethod 42 def stage_order(cls, uuId, stages): 43 """Reorder the Project's Stage links in a customer order.""" 44 url = "/api/project/stage_list/order?holder={}".format(uuId) 45 api.post(url, stages) 46 return True
Reorder the Project's Stage links in a customer order.
@classmethod
def
autoschedule(cls, project, mode='ASAP'):
48 @classmethod 49 def autoschedule(cls, project, mode="ASAP"): 50 """ 51 Autoschedule the project. 52 53 `project`: A Project entity 54 55 `mode`: `ASAP` or `ALAP` 56 """ 57 url = "/api/project/schedule?mode={}".format(mode) 58 api.post(url, [project]) 59 return True
Autoschedule the project.
project: A Project entity
mode: ASAP or ALAP
def
tasks(self):
61 def tasks(self): 62 """Get a list of uuIds of all tasks in this Project.""" 63 payload = { 64 "name": "Task in project", 65 "type": "msql", 66 "start": 0, 67 "limit": -1, 68 "holder": "{}".format(self["uuId"]), 69 "select": [["PROJECT.TASK.uuId"]], 70 } 71 return [t[0] for t in api.query(payload)]
Get a list of uuIds of all tasks in this Project.