Browse Source

dirty bugfix + related FIXME for future real fix

damien 11 years ago
parent
commit
bdb1d52b2d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      pboard/pboard/lib/dbapi.py

+ 7 - 1
pboard/pboard/lib/dbapi.py View File

@@ -88,7 +88,7 @@ def deleteNode(loNode):
88 88
   return
89 89
 
90 90
 def buildTreeListForMenu():
91
-  loNodeList = pbm.DBSession.query(pbmd.PBNode).filter(pbmd.PBNode.node_type==pbmd.PBNodeType.Data).order_by(pbmd.PBNode.parent_tree_path).order_by(pbmd.PBNode.node_order).all()
91
+  loNodeList = pbm.DBSession.query(pbmd.PBNode).filter(pbmd.PBNode.node_type==pbmd.PBNodeType.Data).order_by(pbmd.PBNode.parent_tree_path).order_by(pbmd.PBNode.node_order).order_by(pbmd.PBNode.node_id).all()
92 92
   loTreeList = []
93 93
   loTmpDict = {}
94 94
   for loNode in loNodeList:
@@ -98,6 +98,12 @@ def buildTreeListForMenu():
98 98
       loTreeList.append(loNode)
99 99
     else:
100 100
       # append the node to the parent list
101
+      print "here he go ", loNode.parent_id
102
+      print loTmpDict
103
+      # FIXME - D.A - 2013-10-08
104
+      # The following line may raise an exception
105
+      # We suppose that the parent node has already been added
106
+      # this *should* be the case, but the code does not check it
101 107
       loTmpDict[loNode.parent_id].appendStaticChild(loNode)
102 108
 
103 109
   print "=================="