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:
Craig 2012-03-16 11:27:38 -07:00
commit dea04d64f9

View File

@ -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