'Adjust the limits on the rows retrieved. Use low/high to set these,
as it makes it more Pythonic to read and write. When the SQL query is
created, convert them to the appropriate offset and limit values.
Apply any limits passed in here to the existing constraints. Add low
to the current low value and clamp both to any existing high value.'

def set_limits(self, low=None, high=None):

    if (high is not None):
        if (self.high_mark is not None):
            self.high_mark = min(self.high_mark, (self.low_mark + high))
        else:
            self.high_mark = (self.low_mark + high)
    if (low is not None):
        if (self.high_mark is not None):
            self.low_mark = min(self.high_mark, (self.low_mark + low))
        else:
            self.low_mark = (self.low_mark + low)
    if (self.low_mark == self.high_mark):
        self.set_empty()
