mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-10 00:06:13 +00:00
Added __repr__ method to ElasticSearchResults
This commit is contained in:
parent
1475d440e3
commit
d4aa5d5090
1 changed files with 6 additions and 0 deletions
|
|
@ -221,6 +221,12 @@ class ElasticSearchResults(object):
|
|||
def __len__(self):
|
||||
return len(self._do_search())
|
||||
|
||||
def __repr__(self):
|
||||
data = list(self[:21])
|
||||
if len(data) > 20:
|
||||
data[-1] = "...(remaining elements truncated)..."
|
||||
return repr(data)
|
||||
|
||||
|
||||
class ElasticSearch(BaseSearch):
|
||||
def __init__(self, params):
|
||||
|
|
|
|||
Loading…
Reference in a new issue