draft: improved searching one page only
This commit is contained in:
parent
999299c32a
commit
413d422e2f
@ -254,13 +254,13 @@ class DataObjectSelect(Select):
|
|||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
source_types = list(sorted(self._source_type_to_data_objects.keys(), key=lambda x: x.name))
|
source_types = list(sorted(self._source_type_to_data_objects.keys(), key=lambda x: x.name))
|
||||||
has_limit = len(source_types) > 1
|
single_source = len(source_types) > 1
|
||||||
|
|
||||||
for st in source_types:
|
for st in source_types:
|
||||||
if has_limit:
|
if single_source:
|
||||||
yield self._source_type_to_option[st]
|
yield self._source_type_to_option[st]
|
||||||
|
|
||||||
limit = min(15, len(self._source_type_to_data_objects[st])) if has_limit else len(self._source_type_to_data_objects[st])
|
limit = min(15, len(self._source_type_to_data_objects[st])) if single_source else len(self._source_type_to_data_objects[st])
|
||||||
|
|
||||||
for i in range(limit):
|
for i in range(limit):
|
||||||
yield self._source_type_to_data_objects[st][i]
|
yield self._source_type_to_data_objects[st][i]
|
Loading…
Reference in New Issue
Block a user