forked from jgrewe/fishbook
[frontend] add test flag to find methods
This commit is contained in:
parent
1832bae72c
commit
d968fdac8c
@ -251,7 +251,7 @@ class Dataset:
|
||||
total = len(dataset_list)
|
||||
if not test:
|
||||
for i, d in enumerate(dataset_list):
|
||||
progress(i+1, total, "fetching data")
|
||||
progress(i+1, total, "fetching %i matches" % total)
|
||||
results.append(Dataset(tuple=d))
|
||||
return results, total
|
||||
|
||||
@ -543,13 +543,14 @@ class Subject:
|
||||
return self.__tuple.copy()
|
||||
|
||||
@staticmethod
|
||||
def find(species=None):
|
||||
def find(species=None, test=False):
|
||||
subjs = Subjects & True
|
||||
if species:
|
||||
subjs = (Subjects & "species like '%{0:s}%'".format(species))
|
||||
|
||||
results = []
|
||||
total = len(subjs)
|
||||
if not test:
|
||||
for i, s in enumerate(subjs):
|
||||
results.append(Subject(tuple=s))
|
||||
progress(i+1, total, "fetching %i matches" % total)
|
||||
|
Loading…
Reference in New Issue
Block a user