From 4a20408dd8ce16b1d159cb7acd78a511ef9b8ad0 Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 15 Mar 2003 23:46:08 +0000 Subject: [PATCH] basic numeric support for NumberHTMLProperty git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1592 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/templating.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 0984bc1..ae4f0fa 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -924,6 +924,17 @@ class NumberHTMLProperty(HTMLProperty): value = '"'.join(value.split('"')) return ''%(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 -- 2.39.5