|
@@ -120,8 +120,13 @@ ordering is not implemented yet")
|
120
|
120
|
results, key=operator.itemgetter(*sort_itemgetter_args),
|
121
|
121
|
reverse=False if sort_dir == 'ASC' else True)
|
122
|
122
|
#If limit given apply limit again
|
123
|
|
- if limit is not None:
|
124
|
|
- results = results[offset:offset+limit]
|
|
123
|
+ if offset > len(results):
|
|
124
|
+ results = list()
|
|
125
|
+ else:
|
|
126
|
+ if limit is not None:
|
|
127
|
+ if limit + offset >= len(results):
|
|
128
|
+ limit = len(results)-offset-1
|
|
129
|
+ results = results[offset:offset+limit]
|
125
|
130
|
return results
|
126
|
131
|
# Default behavior
|
127
|
132
|
if filters is None:
|