Skip to content

Commit

Permalink
Create SkipFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jul 29, 2019
1 parent 7e855ce commit f9600ec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ def apply_filter(self, query):
raise BadFilterError(f" Bad filter: {self.direction}")


class SkipFilter(QueryFilter):
def __init__(self, skip_value):
self.skip_value = skip_value

def apply_filter(self, query):
query.base_query = query.base_query.offset(self.skip_value)


class LimitFilter(QueryFilter):
def __init__(self, limit_value):
self.limit_value = limit_value
Expand Down

0 comments on commit f9600ec

Please sign in to comment.