WIP: feature/cleanup_programming_interface #40
@ -254,13 +254,13 @@ class DataObjectSelect(Select):
|
||||
|
||||
def __iter__(self):
|
||||
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:
|
||||
if has_limit:
|
||||
if single_source:
|
||||
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):
|
||||
yield self._source_type_to_data_objects[st][i]
|
Loading…
Reference in New Issue
Block a user