google-code-export / django-mptt

Automatically exported from code.google.com/p/django-mptt
Other
0 stars 0 forks source link

gt_ancestrors() returns an empty list #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by arka...@gmail.com on 23 Dec 2009 at 1:27

GoogleCodeExporter commented 9 years ago
I'm running into similar issues. Details here:

http://stackoverflow.com/questions/2152880/django-mptt-completely-buggy-or-am-i-
doing-
it-wrong

I'm also using r121 .

Original comment by daru...@gmail.com on 28 Jan 2010 at 7:36

GoogleCodeExporter commented 9 years ago
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...

Original comment by craig.ds@gmail.com on 2 Sep 2010 at 1:13

GoogleCodeExporter commented 9 years ago
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.

Original comment by craig.ds@gmail.com on 8 Sep 2010 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by craig.ds@gmail.com on 13 Nov 2010 at 6:36