Skip to content

Commit 3cbfe49

Browse files
author
Richard Jones
committed
notes about sorting
1 parent 30a3c79 commit 3cbfe49

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

doc/FAQ.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Roundup FAQ
33
===========
44

5-
:Version: $Revision: 1.18 $
5+
:Version: $Revision: 1.19 $
66

77
.. contents::
88

@@ -176,6 +176,24 @@ Make sure that the TRACKER_WEB setting in your tracker's config.py is set
176176
to the URL of the tracker.
177177

178178

179+
How is sorting performed, and why does it seem to fail sometimes?
180+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181+
182+
When we sort items in the hyperdb, we use one of a number of methods,
183+
depending on the properties being sorted on:
184+
185+
1. If it's a String, Number, Date or Interval property, we just sort the
186+
scalar value of the property. Strings are sorted case-sensitively.
187+
2. If it's a Link property, we sort by either the linked item's "order"
188+
property (if it has one) or the linked item's "id".
189+
3. Mulitlinks sort similar to #2, but we start with the first
190+
Multilink list item, and if they're the same, we sort by the second item,
191+
and so on.
192+
193+
Note that if an "order" property is defined on a Class that is used for
194+
sorting, all items of that Class *must* have a value against the "order"
195+
property, or sorting will result in random ordering.
196+
179197
-----------------
180198

181199
Back to `Table of Contents`_

doc/customizing.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.151 $
5+
:Version: $Revision: 1.152 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -578,6 +578,25 @@ Create an item in the database. This is generally used to create items
578578
in the "definitional" classes like "priority" and "status".
579579

580580

581+
A note about ordering
582+
~~~~~~~~~~~~~~~~~~~~~
583+
584+
When we sort items in the hyperdb, we use one of a number of methods,
585+
depending on the properties being sorted on:
586+
587+
1. If it's a String, Number, Date or Interval property, we just sort the
588+
scalar value of the property. Strings are sorted case-sensitively.
589+
2. If it's a Link property, we sort by either the linked item's "order"
590+
property (if it has one) or the linked item's "id".
591+
3. Mulitlinks sort similar to #2, but we start with the first Multilink
592+
list item, and if they're the same, we sort by the second item, and
593+
so on.
594+
595+
Note that if an "order" property is defined on a Class that is used for
596+
sorting, all items of that Class *must* have a value against the "order"
597+
property, or sorting will result in random ordering.
598+
599+
581600
Examples of adding to your schema
582601
---------------------------------
583602

0 commit comments

Comments
 (0)