Raise AttributeError when necessary on QuerySet[]

This commit is contained in:
Harry Marr 2010-10-17 16:36:22 +01:00
parent 007f116bfa
commit dcec61e9b2

View File

@ -787,6 +787,7 @@ class QuerySet(object):
# Integer index provided
elif isinstance(key, int):
return self._document._from_son(self._cursor[key])
raise AttributeError
def distinct(self, field):
"""Return a list of distinct values for a given field.