projectal.entities.location API documentation

# projectal.entities.location

View Source

    from datetime import datetime

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

    class Location(Entity, CompanyLinker, CustomerLinker, ProjectLinker, StaffLinker,
                   NoteLinker, CalendarLinker):
        """
        Implementation of the [Location](https://projectal.com/docs/latest/#tag/Location) API.
        """
        _path = 'location'
        _name = 'location'
        _links = [NoteLinker, CalendarLinker]
        _links_reverse = [CompanyLinker, CustomerLinker, ProjectLinker, StaffLinker]

        def calendar(self, begin=None, until=None):
            """
            Get the location's calendar.
            `uuId`: The location `uuId`
            `begin`: Start date in `yyyy-MM-dd` format
            `until`: End date in `yyyy-MM-dd` format
            """
            if begin:
                begin = datetime.strptime(begin, '%Y-%m-%d').date()
            if until:
                until = datetime.strptime(until, '%Y-%m-%d').date()

            url = '/api/location/{}/calendar?'.format(self['uuId'])
            params = []
            params.append('begin={}'.format(begin)) if begin else None
            params.append('until={}'.format(until)) if until else None
            url += '&'.join(params)

            cals = api.get(url)
            cals = [projectal.Calendar(c) for c in cals]
            return cals

class Location(projectal.entity.Entity, projectal.linkers.CompanyLinker, projectal.linkers.CustomerLinker, projectal.linkers.ProjectLinker, projectal.linkers.StaffLinker, projectal.linkers.NoteLinker, projectal.linkers.CalendarLinker):
View Source

    class Location(Entity, CompanyLinker, CustomerLinker, ProjectLinker, StaffLinker,
                   NoteLinker, CalendarLinker):
        """
        Implementation of the [Location](https://projectal.com/docs/latest/#tag/Location) API.
        """
        _path = 'location'
        _name = 'location'
        _links = [NoteLinker, CalendarLinker]
        _links_reverse = [CompanyLinker, CustomerLinker, ProjectLinker, StaffLinker]

        def calendar(self, begin=None, until=None):
            """
            Get the location's calendar.
            `uuId`: The location `uuId`
            `begin`: Start date in `yyyy-MM-dd` format
            `until`: End date in `yyyy-MM-dd` format
            """
            if begin:
                begin = datetime.strptime(begin, '%Y-%m-%d').date()
            if until:
                until = datetime.strptime(until, '%Y-%m-%d').date()

            url = '/api/location/{}/calendar?'.format(self['uuId'])
            params = []
            params.append('begin={}'.format(begin)) if begin else None
            params.append('until={}'.format(until)) if until else None
            url += '&'.join(params)

            cals = api.get(url)
            cals = [projectal.Calendar(c) for c in cals]
            return cals

Implementation of the Location API.

def calendar(self, begin=None, until=None):
View Source

        def calendar(self, begin=None, until=None):
            """
            Get the location's calendar.
            `uuId`: The location `uuId`
            `begin`: Start date in `yyyy-MM-dd` format
            `until`: End date in `yyyy-MM-dd` format
            """
            if begin:
                begin = datetime.strptime(begin, '%Y-%m-%d').date()
            if until:
                until = datetime.strptime(until, '%Y-%m-%d').date()

            url = '/api/location/{}/calendar?'.format(self['uuId'])
            params = []
            params.append('begin={}'.format(begin)) if begin else None
            params.append('until={}'.format(until)) if until else None
            url += '&'.join(params)

            cals = api.get(url)
            cals = [projectal.Calendar(c) for c in cals]
            return cals

Get the location's calendar. `uuId`: The location `uuId` `begin`: Start date in `yyyy-MM-dd` format `until`: End date in `yyyy-MM-dd` format

##### 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.CompanyLinker
  link_company
  unlink_company
projectal.linkers.CustomerLinker
  link_customer
  unlink_customer
projectal.linkers.ProjectLinker
  link_project
  unlink_project
projectal.linkers.StaffLinker
  link_staff
  relink_staff
  unlink_staff
builtins.dict
  setdefault
  pop
  popitem
  keys
  items
  values
  fromkeys
  clear
  copy