| Issue 7: | DOM like functions | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Type: Enhancement
Priority: Medium
Hi,
I think these two things taken from the DOM model would be very handy for
the mptt model interface:
* parent field
n = Node.geti(id=1)
if not n.is_root():
print n.parent.name
* add_child(node)
n = Node(name='new child')
Node.get(id=1).add_child(n)
Thanks.
Jan 10, 2008
Project Member
#1
jonathan.buchanan
Labels:
-Type-Defect Type-Enhancement
Jan 10, 2008
Sorry I forgot that there is already a parent column which have to be defined in the model fields.
Jan 14, 2008
I think putting in an add_child method would be unnecessary, as the Django ORM already provides a way to do this through the backward relationship [1], which people will already be used to and which works with MPTT: Node.get(pk=1).children.create(name='New child') [1] http://www.djangoproject.com/documentation/db-api/#backward
Status:
WontFix
|