diff doc/customizing.txt @ 6414:3dbf1bc5e567

issue2551120 - The sorted method of MultilinkHTMLProperty crashes ... if the given property is unset for an element of the list. Crash fixed. New feature NoneFirst added to method to make unset values sort at start or end of sorted list. Current testing framework for this code is insuffient for testing change. Committing without automated test because it solves a crash.
author John Rouillard <rouilj@ieee.org>
date Mon, 17 May 2021 15:25:17 -0400
parents ce99e0d39262
children 586865e08f42
line wrap: on
line diff
--- a/doc/customizing.txt	Mon May 17 20:52:27 2021 +0200
+++ b/doc/customizing.txt	Mon May 17 15:25:17 2021 -0400
@@ -3292,7 +3292,17 @@
                python:context.files.sorted('creation', reverse=True)
 
             Will list the files by upload date in reverse order from
-            the prior example.
+            the prior example. If the property can be unset, you can
+            use the ``NoneFirst`` parameter to sort the None/Unset
+            values at the front or the end of the list. For example::
+            
+                python:context.files.sorted('creation', NoneFirst=True)
+            
+            will sort files by creation date with files missing a
+            creation date at the start of the list. The default for
+            ``NoneFirst`` is False so these files will sort at the end
+            by default. (Note creation date is never unset, but you
+            get the idea.) 
 reverse     only on Multilink properties - produce a list of the linked
             items in reverse order
 isset       returns True if the property has been set to a value

Roundup Issue Tracker: http://roundup-tracker.org/