Permalink
Browse files

Added convenient setProperties method to set multiple properties in o…

…ne single call
  • Loading branch information...
1 parent 46fffe6 commit 56bfb1e5b38c9ee428ae7e7f1cf168826a83b155 @escalant3 committed Apr 19, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 pyblueprints/neo4j.py
View
@@ -126,9 +126,16 @@ def getPropertyKeys(self):
def setProperty(self, key, value):
"""Sets the property of the element to the given value
@params key: The property key to set
- @params value: The value to set"""
+ @params value: The value to set. """
self.neoelement.set(key, value)
+ def setProperties(self, new_dict):
+ element_properties = self.neoelement.properties.copy()
+ for key, value in new_dict.iteritems():
+ new_dict[key] = unicode(value)
+ element_properties.update(new_dict)
+ self.neoelement.properties = element_properties
+
def getId(self):
"""Returns the unique identifier of the element

0 comments on commit 56bfb1e

Please sign in to comment.