diff roundup/cgi/templating.py @ 4043:32965347a663

Allow 'no value' to be selected in LinkHTMLProperty.menu()
author Stefan Seefeld <stefan@seefeld.name>
date Mon, 16 Feb 2009 21:26:29 +0000
parents 8831882170fc
children 047402c4ec9b
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Mon Feb 16 21:19:51 2009 +0000
+++ b/roundup/cgi/templating.py	Mon Feb 16 21:26:29 2009 +0000
@@ -1873,8 +1873,14 @@
         if not self.is_edit_ok():
             return self.plain(escape=1)
 
+        # Since None indicates the default, we need another way to
+        # indicate "no selection".  We use -1 for this purpose, as
+        # that is the value we use when submitting a form without the
+        # value set.
         if value is None:
             value = self._value
+        elif value == '-1':
+            value = None
 
         linkcl = self._db.getclass(self._prop.classname)
         l = ['<select name="%s">'%self._formname]

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