Skip to content

Commit

Permalink
[model][xs]: limit search results to 20 by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrp committed Mar 19, 2011
1 parent dd6aa54 commit 178b587
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion annotator/model/couch.py
Expand Up @@ -106,11 +106,14 @@ def from_dict(cls, dict_):
def search(self, **kwargs):
'''Search by arbitrary attributes.
:param limit: limit the number of results (-1 indicates no limit)
WARNING: at the moment use temporary views.
'''
non_query_args = ['offset', 'limit', 'all_fields']
offset = int(kwargs.get('offset', 0))
limit = int(kwargs.get('limit', -1))
limit = int(kwargs.get('limit', 20))
for k in non_query_args:
if k in kwargs:
del kwargs[k]
Expand Down

0 comments on commit 178b587

Please sign in to comment.