diff roundup/cgi/templating.py @ 1518:bb843662b708

basic numeric support for NumberHTMLProperty
author Richard Jones <richard@users.sourceforge.net>
date Sat, 15 Mar 2003 23:46:08 +0000
parents 455f79a2981f
children 5a6fb50800b9
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Fri Mar 14 02:52:03 2003 +0000
+++ b/roundup/cgi/templating.py	Sat Mar 15 23:46:08 2003 +0000
@@ -924,6 +924,17 @@
             value = '&quot;'.join(value.split('"'))
         return '<input name="%s" value="%s" size="%s">'%(self._formname, value, size)
 
+    def __int__(self):
+        ''' Return an int of me
+        '''
+        return int(self._value)
+
+    def __float__(self):
+        ''' Return a float of me
+        '''
+        return float(self._value)
+
+
 class BooleanHTMLProperty(HTMLProperty):
     def plain(self):
         ''' Render a "plain" representation of the property

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