Browse Source

dirty bugfix + related FIXME for future real fix

damien 12 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
   return
88
   return
89
 
89
 
90
 def buildTreeListForMenu():
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
   loTreeList = []
92
   loTreeList = []
93
   loTmpDict = {}
93
   loTmpDict = {}
94
   for loNode in loNodeList:
94
   for loNode in loNodeList:
98
       loTreeList.append(loNode)
98
       loTreeList.append(loNode)
99
     else:
99
     else:
100
       # append the node to the parent list
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
       loTmpDict[loNode.parent_id].appendStaticChild(loNode)
107
       loTmpDict[loNode.parent_id].appendStaticChild(loNode)
102
 
108
 
103
   print "=================="
109
   print "=================="