'Convert start+limit parameters into a limitby tuple
- limit without start => start = 0
- start without limit => limit = ROWSPERPAGE
- limit 0 (or less)   => limit = 1
- start less than 0   => start = 0
@param start: index of the first record to select
@param limit: maximum number of records to select'

def limitby(self, start=0, limit=0):

    if (limit is None):
        return None
    if (start is None):
        start = 0
    if (limit == 0):
        limit = current.response.s3.ROWSPERPAGE
    if (limit <= 0):
        limit = 1
    if (start < 0):
        start = 0
    return (start, (start + limit))
