Skip to content

Commit 3a7c92a

Browse files
author
Richard Jones
committed
add "checked" to truth values for Boolean input
1 parent 930a555 commit 3a7c92a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Feature:
77
- added support for HTTP charset selection
88

99

10+
2004-05-?? 0.7.3
11+
Fixed:
12+
- add "checked" to truth values for Boolean input
13+
14+
1015
2004-05-?? 0.7.2
1116
Fixed:
1217
- anydbm sorting with None values (sf bug 952853)

roundup/hyperdb.py

Lines changed: 3 additions & 2 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: hyperdb.py,v 1.97 2004-05-02 23:16:05 richard Exp $
18+
# $Id: hyperdb.py,v 1.98 2004-05-18 21:53:18 richard Exp $
1919

2020
"""Hyperdatabase implementation, especially field types.
2121
"""
@@ -743,7 +743,8 @@ def rawToHyperdb(db, klass, itemid, propname, value,
743743
value = [str(x) for x in value]
744744
elif isinstance(proptype, Boolean):
745745
value = value.strip()
746-
value = value.lower() in ('yes', 'true', 'on', '1')
746+
# checked is a common HTML checkbox value
747+
value = value.lower() in ('checked', 'yes', 'true', 'on', '1')
747748
elif isinstance(proptype, Number):
748749
value = value.strip()
749750
try:

0 commit comments

Comments
 (0)