Commit 87d2c1f2 authored by sim's avatar sim

Add id attribute to Node repr

parent 4c5ab76f
...@@ -50,9 +50,9 @@ class Node(Base): ...@@ -50,9 +50,9 @@ class Node(Base):
"""Automagically cast a new Node to its sub-class! """Automagically cast a new Node to its sub-class!
>>> Node(name='without-type') >>> Node(name='without-type')
<Node(typename=None, user_id=None, parent_id=None, name='without-type', date=None)> <Node(id=None, typename=None, user_id=None, parent_id=None, name='without-type', date=None)>
>>> Node(typename='CORPUS') >>> Node(typename='CORPUS')
<CorpusNode(typename='CORPUS', user_id=None, parent_id=None, name=None, date=None)> <CorpusNode(id=None, typename='CORPUS', user_id=None, parent_id=None, name=None, date=None)>
""" """
if cls is Node and kwargs.get('typename'): if cls is Node and kwargs.get('typename'):
...@@ -79,7 +79,8 @@ class Node(Base): ...@@ -79,7 +79,8 @@ class Node(Base):
self.hyperdata[key] = value self.hyperdata[key] = value
def __repr__(self): def __repr__(self):
return '<{0.__class__.__name__}(typename={0.typename!r}, user_id={0.user_id}, parent_id={0.parent_id}, ' \ return '<{0.__class__.__name__}(id={0.id}, typename={0.typename!r}, ' \
'user_id={0.user_id}, parent_id={0.parent_id}, ' \
'name={0.name!r}, date={0.date})>'.format(self) 'name={0.name!r}, date={0.date})>'.format(self)
@property @property
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment