| Issue 66: | gt_ancestrors() returns an empty list | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Create a simple model, mine only have a custom parent field called "categoria", doesn't seem to be the source of the problem 2. Add mptt.register to models (try/catch) stuff to prevent AlreadyRegistered exception 3. Create some registers with the shell that form a hierarchy, then call <ModelName>.get_anchestors() What is the expected output? What do you see instead? I expected to get the list of ancestors, but got an empty list instead What version of the product are you using? On what operating system? SVN trunk, revision 121 Please provide any additional information below.
Jan 27, 2010
#1
daru...@gmail.com
Sep 2, 2010
When you change a node, django-mptt updates the tree fields on some of the other nodes in the same tree.
This means if you have references to those nodes, the tree fields on them will be wrong.
Refreshing them from the database solves it:
nodes[0] = Node.objects.get(pk=nodes[0].pk)
Open to suggestions as to how to fix this disparity...
Status:
Chatting
Sep 8, 2010
It looks like if http://code.djangoproject.com/ticket/17 lands in django, this issue may be solved. If this is a blocker for you, consider applying the patch at that link to your django build. No guarantees, I haven't tested it. If it works for you, please comment to let us know.
Nov 12, 2010
(No comment was entered for this change.)
Status:
Duplicate
Mergedinto: 78 |