Skip to content

Commit 982cb05

Browse files
author
Roche Compaan
committed
Sorting was applied to all nodes of the MultiLink class...
...instead of the nodes that are actually linked to in the "field" template function. This adds about 20+ seconds in the display of an issue if your database has a 1000 or more issue in it.
1 parent f140ec8 commit 982cb05

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Fixed:
2626
. stop sending blank (whitespace-only) notes
2727
. cleanup of serialisation for database storage
2828
. node ids are now generated from a lockable store - no more race conditions
29+
. sorting was applied to all nodes of the MultiLink class instead of
30+
to the nodes that are actually linked to in the "field" template
31+
function. This adds about 20+ seconds in the display of an issue if
32+
your database has a 1000 or more issues in it.
2933

3034

3135
2002-03-25 - 0.4.1

roundup/htmltemplate.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: htmltemplate.py,v 1.87 2002-04-03 06:12:46 richard Exp $
18+
# $Id: htmltemplate.py,v 1.88 2002-04-24 08:34:35 rochecompaan Exp $
1919

2020
__doc__ = """
2121
Template engine.
@@ -223,9 +223,8 @@ def do_field(self, property, size=None, showid=0):
223223
elif isinstance(propclass, hyperdb.Multilink):
224224
sortfunc = self.make_sort_function(propclass.classname)
225225
linkcl = self.db.classes[propclass.classname]
226-
list = linkcl.list()
227-
list.sort(sortfunc)
228-
l = []
226+
if value:
227+
value.sort(sortfunc)
229228
# map the id to the label property
230229
if not showid:
231230
k = linkcl.labelprop()
@@ -1128,6 +1127,9 @@ def render(self, form):
11281127

11291128
#
11301129
# $Log: not supported by cvs2svn $
1130+
# Revision 1.87 2002/04/03 06:12:46 richard
1131+
# Fix for date properties as labels.
1132+
#
11311133
# Revision 1.86 2002/04/03 05:54:31 richard
11321134
# Fixed serialisation problem by moving the serialisation step out of the
11331135
# hyperdb.Class (get, set) into the hyperdb.Database.

0 commit comments

Comments
 (0)