def __delitem__(self, key):
del self._store[key]
+ def booleanize_post(self, post, key):
+ '''The key, if present, is a boolean value. But post data
+ is all strings. Convert the post data to a Python boolean.
+ '''
+ if key in post:
+ if post[key] == 'False':
+ post[key] = False
+ else:
+ post[key] = True
+
def read_post_and_session(self, post, session, key):
'''Read an attribute into self, from either POST or the session,
and synchronize the session with the POST value when there is a POST
# Other POST variables involving a file
post = self.uh.request.POST
session = self.uh.request.session
+ self.booleanize_post(post, 'db_changed')
if not self.read_post_and_session(post, session, 'db_changed'):
self['db_changed'] = False
self['filename'] = ''