Skip to content

Commit

Permalink
Merge pull request boto#342 from mansam/master
Browse files Browse the repository at this point in the history
Added 'delete_attributes' to Model
  • Loading branch information
kopertop committed Sep 18, 2011
2 parents ebf515f + 0a37a87 commit 5dca7f1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boto/sdb/db/model.py
Expand Up @@ -219,6 +219,19 @@ def put_attributes(self, attrs):
self.reload()
return self

def delete_attributes(self, attrs):
"""Delete just these attributes,
not the whole object.
:param attrs: Attributes to save, as a list of string names
:type attrs: list
:return: self
:rtype: :class:boto.sdb.db.model.Model
"""
assert(isinstance(attrs, list)), "Argument must be a list of names of keys to delete."
self._manager.domain.delete_attributes(self.id, attrs)
self.reload()
return self

save_attributes = put_attributes

def delete(self):
Expand Down

0 comments on commit 5dca7f1

Please sign in to comment.