소스 검색

update editnode

oz123 10 년 전
부모
커밋
ba9e7fcf3b
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      pwman/data/drivers/mongodb.py

+ 3 - 2
pwman/data/drivers/mongodb.py

@@ -55,7 +55,7 @@ class MongoDB(Database):
         nodes = []
         for node in node_dicts:
             n = [node['_id'],
-                 node['user'],
+                 node['username'],
                  node['password'],
                  node['url'],
                  node['notes']]
@@ -86,7 +86,8 @@ class MongoDB(Database):
         return tags
 
     def editnode(self, nid, **kwargs):
-        pass
+        self._db.nodes.update({'_id': nid}, { '$set' : kwargs})
+
 
     def removenodes(self, nid):
         self._db.nodes.remove({'_id': {'$in': nid}})