comparison roundup/cgi/templating.py @ 2289:6d16b967f89d

HTML templating isset() inverted [SF#951779]
author Richard Jones <richard@users.sourceforge.net>
date Wed, 12 May 2004 22:35:12 +0000
parents a13ec40cf8f5
children 7c8d2e9a0566
comparison
equal deleted inserted replaced
2287:49f69762c66a 2289:6d16b967f89d
5 - Most methods should have a "default" arg to supply a value 5 - Most methods should have a "default" arg to supply a value
6 when none appears in the hyperdb or request. 6 when none appears in the hyperdb or request.
7 - Multilink property additions: change_note and new_upload 7 - Multilink property additions: change_note and new_upload
8 - Add class.find() too 8 - Add class.find() too
9 - NumberHTMLProperty should support numeric operations 9 - NumberHTMLProperty should support numeric operations
10 - HTMLProperty should have an isset() method
11 ''' 10 '''
12 11
13 __docformat__ = 'restructuredtext' 12 __docformat__ = 'restructuredtext'
14 13
15 from __future__ import nested_scopes 14 from __future__ import nested_scopes
1016 if isinstance(other, HTMLProperty): 1015 if isinstance(other, HTMLProperty):
1017 return cmp(self._value, other._value) 1016 return cmp(self._value, other._value)
1018 return cmp(self._value, other) 1017 return cmp(self._value, other)
1019 1018
1020 def isset(self): 1019 def isset(self):
1021 '''Is my _value None?''' 1020 '''Is my _value not None?'''
1022 return self._value is None 1021 return self._value is not None
1023 1022
1024 def is_edit_ok(self): 1023 def is_edit_ok(self):
1025 ''' Is the user allowed to Edit the current class? 1024 ''' Is the user allowed to Edit the current class?
1026 ''' 1025 '''
1027 thing = HTMLDatabase(self._client)[self._classname] 1026 thing = HTMLDatabase(self._client)[self._classname]
1554 value is a string first, not a HTMLProperty. 1553 value is a string first, not a HTMLProperty.
1555 ''' 1554 '''
1556 return str(value) in self._value 1555 return str(value) in self._value
1557 1556
1558 def isset(self): 1557 def isset(self):
1559 '''Is my _value []?''' 1558 '''Is my _value not []?'''
1560 return self._value == [] 1559 return self._value != []
1561 1560
1562 def reverse(self): 1561 def reverse(self):
1563 ''' return the list in reverse order 1562 ''' return the list in reverse order
1564 ''' 1563 '''
1565 l = self._value[:] 1564 l = self._value[:]

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