Skip to content

Commit 7728b14

Browse files
author
Richard Jones
committed
basic numeric support for NumberHTMLProperty
1 parent 7ae3dbc commit 7728b14

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

roundup/cgi/templating.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,17 @@ def field(self, size = 30):
924924
value = '"'.join(value.split('"'))
925925
return '<input name="%s" value="%s" size="%s">'%(self._formname, value, size)
926926

927+
def __int__(self):
928+
''' Return an int of me
929+
'''
930+
return int(self._value)
931+
932+
def __float__(self):
933+
''' Return a float of me
934+
'''
935+
return float(self._value)
936+
937+
927938
class BooleanHTMLProperty(HTMLProperty):
928939
def plain(self):
929940
''' Render a "plain" representation of the property

0 commit comments

Comments
 (0)