exactonline/api/v1division.py
def set_division(self, division):
        """
        Select the "current" division that we'll be working on/with.
        """
        try:
            division = int(division)
        except (TypeError, ValueError):
            raise V1DivisionError('Supplied division %r is not a number' %
                                  (division,))

        urlbase = 'v1/%d/' % (division,)
        resource = urljoin(
            urlbase,
            "crm/Accounts?$select=ID&$filter=Name+eq+'DOES_NOT_EXIST'")
        try:
            self.rest(GET(resource))
        except AssertionError:
            raise V1DivisionError('Invalid division %r according to server' %
                                  (division,))

        self.storage.set_division(division)
def set_division(self, division):
        """
        Select the "current" division that we'll be working on/with.
        """
        try:
            division = int(division)
        except (TypeError, ValueError):
            raise V1DivisionError('Supplied division %r is not a number' %
                                  (division,))

        urlbase = 'v1/%d/' % (division,)
        resource = urljoin(
            urlbase,
            "crm/Accounts?$select=ID&$filter=Name+eq+'DOES_NOT_EXIST'")
        try:
            self.rest(GET(resource))
        except AssertionError:
            raise V1DivisionError('Invalid division %r according to server' %
                                  (division,))

        self.storage.set_division(division)
def set_division ( self , division ) : try : division = int ( division ) except ( TypeError , ValueError ) : raise V1DivisionError ( 'Supplied division %r is not a number' % ( division , ) ) urlbase = 'v1/%d/' % ( division , ) resource = urljoin ( urlbase , "crm/Accounts?$select=ID&$filter=Name+eq+'DOES_NOT_EXIST'" ) try : self . rest ( GET ( resource ) ) except AssertionError : raise V1DivisionError ( 'Invalid division %r according to server' % ( division , ) ) self . storage . set_division ( division )
Select the "current" division that we'll be working on/with.
Select the current division that we ll be working on / with .