Просмотр исходного кода

Add __repr__ method to new Node class

oz123 10 лет назад
Родитель
Сommit
aa6323b469
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      pwman/data/nodes.py

+ 7 - 0
pwman/data/nodes.py

@@ -154,6 +154,13 @@ class Node(object):
         node._tags = [t.strip() for t in tags]
         return node
 
+    def __repr__(self):
+        """we use this method to write node to the database"""
+        res = u''
+        for item in self.__dir__:
+            res += self.__dir__[item]
+        return res
+
     @property
     def password(self):
         """Get the current password."""