google-code-export / django-mptt

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

Fix order_by for queryset in cache_tree_children #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think you must set the forced sort to avoid error "ValueError 
(cache_tree_children was passed nodes in the wrong order!").

Fix:
  ...
  current_path = []
  top_nodes = []
+ queryset = queryset.order_by('tree_id', 'lft')
  if queryset:
     ...

Original issue reported on code.google.com by sirkonst@gmail.com on 14 Dec 2010 at 2:32

GoogleCodeExporter commented 9 years ago
Migrated to https://github.com/django-mptt/django-mptt/issues/#issue/105

Original comment by craig.ds@gmail.com on 19 Dec 2010 at 1:11