projectal.entities.project API documentation

# projectal.entities.project

View Source

    from projectal.entity import Entity
    from projectal.linkers import *
    from projectal import api

    class Project(Entity,  LocationLinker, CustomerLinker, FileLinker, StageLinker,
                  RebateLinker, StageListLinker, CompanyLinker, NoteLinker):
        """
        Implementation of the [Project](https://projectal.com/docs/latest/#tag/Project) API.
        """
        _path = 'project'
        _name = 'project'
        _links = [LocationLinker, CustomerLinker, FileLinker, StageLinker,
                  RebateLinker, StageListLinker, NoteLinker]
        _links_reverse = [CompanyLinker]

        @classmethod
        def stage_order(cls, uuId, stages):
            """Reorder the Project's Stage links in a customer order."""
            url = '/api/project/stage_list/order?holder={}'.format(uuId)
            api.post(url, stages)
            return True

        @classmethod
        def autoschedule(cls, project, mode='ASAP'):
            """
            Autoschedule the project.

            `project`: A Project entity

            `mode`: `ASAP` or `ALAP`
            """
            url = '/api/project/schedule?mode={}'.format(mode)
            api.post(url, [project])
            return True

        def tasks(self):
            """Get a list of uuIds of all tasks in this Project."""
            payload = {
                "name": "Task in project",
                "type": "msql",
                "start": 0,
                "limit": -1,
                "holder": "{}".format(self['uuId']),
                "select": [
                    [
                        "PROJECT.TASK.uuId"
                    ]
                ],
            }
            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):
View Source

    class Project(Entity,  LocationLinker, CustomerLinker, FileLinker, StageLinker,
                  RebateLinker, StageListLinker, CompanyLinker, NoteLinker):
        """
        Implementation of the [Project](https://projectal.com/docs/latest/#tag/Project) API.
        """
        _path = 'project'
        _name = 'project'
        _links = [LocationLinker, CustomerLinker, FileLinker, StageLinker,
                  RebateLinker, StageListLinker, NoteLinker]
        _links_reverse = [CompanyLinker]

        @classmethod
        def stage_order(cls, uuId, stages):
            """Reorder the Project's Stage links in a customer order."""
            url = '/api/project/stage_list/order?holder={}'.format(uuId)
            api.post(url, stages)
            return True

        @classmethod
        def autoschedule(cls, project, mode='ASAP'):
            """
            Autoschedule the project.

            `project`: A Project entity

            `mode`: `ASAP` or `ALAP`
            """
            url = '/api/project/schedule?mode={}'.format(mode)
            api.post(url, [project])
            return True

        def tasks(self):
            """Get a list of uuIds of all tasks in this Project."""
            payload = {
                "name": "Task in project",
                "type": "msql",
                "start": 0,
                "limit": -1,
                "holder": "{}".format(self['uuId']),
                "select": [
                    [
                        "PROJECT.TASK.uuId"
                    ]
                ],
            }
            return [t[0] for t in api.query(payload)]

Implementation of the Project API.

@classmethod
def stage_order(cls, uuId, stages):
View Source

        @classmethod
        def stage_order(cls, uuId, stages):
            """Reorder the Project's Stage links in a customer order."""
            url = '/api/project/stage_list/order?holder={}'.format(uuId)
            api.post(url, stages)
            return True

Reorder the Project's Stage links in a customer order.

@classmethod
def autoschedule(cls, project, mode='ASAP'):
View Source

        @classmethod
        def autoschedule(cls, project, mode='ASAP'):
            """
            Autoschedule the project.

            `project`: A Project entity

            `mode`: `ASAP` or `ALAP`
            """
            url = '/api/project/schedule?mode={}'.format(mode)
            api.post(url, [project])
            return True

Autoschedule the project.

`project`: A Project entity

`mode`: `ASAP` or `ALAP`

def tasks(self):
View Source

        def tasks(self):
            """Get a list of uuIds of all tasks in this Project."""
            payload = {
                "name": "Task in project",
                "type": "msql",
                "start": 0,
                "limit": -1,
                "holder": "{}".format(self['uuId']),
                "select": [
                    [
                        "PROJECT.TASK.uuId"
                    ]
                ],
            }
            return [t[0] for t in api.query(payload)]

Get a list of uuIds of all tasks in this Project.

##### Inherited Members

projectal.entity.Entity
  Entity
  get
  update
  delete
  history
  create
  save
  clone
  list
  match
  match_startswith
  match_endswith
  match_one
  match_startswith_one
  match_endswith_one
  search
  query
  profile_get
  profile_set
  changes
  set_readonly
  entity_name
projectal.linkers.LocationLinker
  link_location
  unlink_location
projectal.linkers.CustomerLinker
  link_customer
  unlink_customer
projectal.linkers.FileLinker
  link_file
  unlink_file
projectal.linkers.StageLinker
  link_stage
  unlink_stage
projectal.linkers.RebateLinker
  link_rebate
  unlink_rebate
projectal.linkers.StageListLinker
  link_stage_list
  unlink_stage_list
projectal.linkers.CompanyLinker
  link_company
  unlink_company
builtins.dict
  setdefault
  pop
  popitem
  keys
  items
  values
  fromkeys
  clear
  copy