comparison 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
comparison
equal deleted inserted replaced
1515:a516bbb9896b 1518:bb843662b708
922 else: 922 else:
923 value = cgi.escape(str(self._value)) 923 value = cgi.escape(str(self._value))
924 value = '&quot;'.join(value.split('"')) 924 value = '&quot;'.join(value.split('"'))
925 return '<input name="%s" value="%s" size="%s">'%(self._formname, value, size) 925 return '<input name="%s" value="%s" size="%s">'%(self._formname, value, size)
926 926
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
927 class BooleanHTMLProperty(HTMLProperty): 938 class BooleanHTMLProperty(HTMLProperty):
928 def plain(self): 939 def plain(self):
929 ''' Render a "plain" representation of the property 940 ''' Render a "plain" representation of the property
930 ''' 941 '''
931 if self._value is None: 942 if self._value is None:

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