Explorar el Código

Add __repr__ method to new Node class

oz123 hace 10 años
padre
commit
aa6323b469
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  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."""