Skip to content

Commit

Permalink
Merge pull request #17 from japerk/patch-1
Browse files Browse the repository at this point in the history
Update __init__.py, Thanks @japerk!
  • Loading branch information
vmalloc committed Apr 4, 2013
2 parents c425a53 + 98f4d02 commit a22ab79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mongomock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def update(self, spec, document, upsert = False, manipulate = False,
document.update(spec)
self.insert(document)

def find(self, spec = None, fields = None, filter = None):
def find(self, spec = None, fields = None, filter = None, sort = None):
if filter is not None:
_print_deprecation_warning('filter', 'spec')
if spec is None:
Expand All @@ -202,9 +202,9 @@ def _copy_only_fields(self, doc, fields):

def _iter_documents(self, filter = None):
return (document for document in itervalues(self._documents) if self._filter_applies(filter, document))
def find_one(self, filter = None):
def find_one(self, spec=None, **kwargs):
try:
return next(self.find(filter))
return next(self.find(spec, **kwargs))
except StopIteration:
return None

Expand Down

0 comments on commit a22ab79

Please sign in to comment.