Merge pull request #20 from TimSimpsonR/pep8-and-import-fix
Adding getattr and setattr back to fix the bug I just added.
This commit is contained in:
commit
dea04d64f9
@ -45,6 +45,12 @@ class ModelBase(object):
|
||||
# self._validate()
|
||||
return self.errors == {}
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
setattr(self, key, value)
|
||||
|
||||
def __getitem__(self, key):
|
||||
return getattr(self, key)
|
||||
|
||||
def __eq__(self, other):
|
||||
if not hasattr(other, 'id'):
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user