Document dict access now only looks for fields
This commit is contained in:
parent
af1d7ef664
commit
4ae21a671d
@ -202,8 +202,10 @@ class BaseDocument(object):
|
||||
"""Dictionary-style field access, return a field's value if present.
|
||||
"""
|
||||
try:
|
||||
if name in self._fields:
|
||||
return getattr(self, name)
|
||||
except AttributeError:
|
||||
pass
|
||||
raise KeyError(name)
|
||||
|
||||
def __setitem__(self, name, value):
|
||||
|
Loading…
x
Reference in New Issue
Block a user