Skip to content

Commit e6c74ed

Browse files
author
Richard Jones
committed
implement __nonzero__ for HTMLProperty
1 parent e9162a5 commit e6c74ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

roundup/cgi/templating.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,9 @@ def __cmp__(self, other):
10181018
return cmp(self._value, other._value)
10191019
return cmp(self._value, other)
10201020

1021+
def __nonzero__(self):
1022+
return not not self._value
1023+
10211024
def isset(self):
10221025
'''Is my _value not None?'''
10231026
return self._value is not None

0 commit comments

Comments
 (0)