syncing both PLCAPI branches
[plcapi.git] / PLC / Methods / AddNode.py
index cacfdb2..8d253df 100644 (file)
@@ -33,9 +33,6 @@ class AddNode(Method):
 
     returns = Parameter(int, 'New node_id (> 0) if successful')
 
-    event_type = 'Add'
-    object_type = 'Node'
-
     def call(self, auth, site_id_or_login_base, node_fields):
         node_fields = dict(filter(can_update, node_fields.items()))
 
@@ -60,11 +57,10 @@ class AddNode(Method):
 
         node = Node(self.api, node_fields)
         node['site_id'] = site['site_id']
-        # xxx temporary, until I figure a way to get local/foreign nodes
-        # so far I cannot seem to use a filter/dict like {'~peer_id':None}
-        # node['peer_id'] = 0
         node.sync()
 
-       self.object_ids = [site['site_id'], node['node_id']]    
+       self.event_objects = {'Site': [site['site_id']],
+                            'Node': [node['node_id']]} 
+       self.message = "Node %s created" % node['node_id']
 
         return node['node_id']