Skip to content

Commit

Permalink
Quick fix...gives base Model an update() method to make it behave lik…
Browse files Browse the repository at this point in the history
…e a dict.
  • Loading branch information
[email protected] committed Oct 15, 2010
1 parent 381afa4 commit 86ed432
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions glance/parallax/db/sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ def delete(self, session=None):
self.deleted_at = datetime.datetime.utcnow()
self.save(session=session)

def update(self, values):
"""dict.update() behaviour."""
for k, v in values.iteritems():
self[k] = v

def __setitem__(self, key, value):
setattr(self, key, value)

Expand Down

0 comments on commit 86ed432

Please sign in to comment.