Skip to content

Commit

Permalink
Database update, fixed the find function
Browse files Browse the repository at this point in the history
  • Loading branch information
Max00355 committed Dec 7, 2013
1 parent 26a38bc commit 2ffdbd0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions landerdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ def find(self, collection, data):
output = []
for x in self.json_data[collection]:
if data != "all":
yes = True
for y in data:
try:
if data[y] == x[y]:
output.append(x)
except KeyError:
continue
if y not in x:
yes = False
break
else:
if data[y] != x[y]:
yes = False
break
if yes and x not in output:
output.append(x)

else:
output.append(x)
return output
Expand Down

0 comments on commit 2ffdbd0

Please sign in to comment.