exactonline/api/v1division.py
def get_divisions(self):
        """
        Get the "current" division and return a dictionary of divisions
        so the user can select the right one.
        """
        ret = self.rest(GET('v1/current/Me?$select=CurrentDivision'))
        current_division = ret[0]['CurrentDivision']
        assert isinstance(current_division, int)

        urlbase = 'v1/%d/' % (current_division,)
        resource = urljoin(urlbase, 'hrm/Divisions?$select=Code,Description')
        ret = self.rest(GET(resource))

        choices = dict((i['Code'], i['Description']) for i in ret)
        return choices, current_division
def get_divisions(self):
        ret = self.rest(GET('v1/current/Me?$select=CurrentDivision'))
        current_division = ret[0]['CurrentDivision']
        assert isinstance(current_division, int)

        urlbase = 'v1/%d/' % (current_division,)
        resource = urljoin(urlbase, 'hrm/Divisions?$select=Code,Description')
        ret = self.rest(GET(resource))

        choices = dict((i['Code'], i['Description']) for i in ret)
        return choices, current_division
def get_divisions ( self ) : ret = self . rest ( GET ( 'v1/current/Me?$select=CurrentDivision' ) ) current_division = ret [ 0 ] [ 'CurrentDivision' ] assert isinstance ( current_division , int ) urlbase = 'v1/%d/' % ( current_division , ) resource = urljoin ( urlbase , 'hrm/Divisions?$select=Code,Description' ) ret = self . rest ( GET ( resource ) ) choices = dict ( ( i [ 'Code' ] , i [ 'Description' ] ) for i in ret ) return choices , current_division
Get the "current" division and return a dictionary of divisions
        so the user can select the right one.
Get the current division and return a dictionary of divisions so the user can select the right one .