Commit f914da17 authored by 's avatar

Removed the manual wrapper checking from property mgmt; the database now

refuses to store wrapped objects, which makes the app-level checks no
longer necessary.
parent c33e3381
......@@ -87,9 +87,9 @@
Folders are the basic container objects and are analogous to directories.
$Id: Folder.py,v 1.88 2000/05/16 19:34:43 brian Exp $"""
$Id: Folder.py,v 1.89 2000/05/17 20:04:25 brian Exp $"""
__version__='$Revision: 1.88 $'[11:-2]
__version__='$Revision: 1.89 $'[11:-2]
import Globals, SimpleItem, ObjectManager, PropertyManager
import AccessControl.Role, webdav.Collection, FindSupport
......@@ -112,7 +112,7 @@ def manage_addFolder(self, id, title='',
"""
ob=Folder()
ob.id=str(id)
ob.title=str(title)
ob.title=title
self._setObject(id, ob)
ob=self._getOb(id)
......
......@@ -84,7 +84,7 @@
##############################################################################
"""Property management"""
__version__='$Revision: 1.21 $'[11:-2]
__version__='$Revision: 1.22 $'[11:-2]
import ExtensionClass, Globals
import ZDOM
......@@ -289,14 +289,9 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
# Web interface
def _wrapperCheck(self, object):
if hasattr(object, 'aq_base'):
raise ValueError, 'Invalid property value: wrapped object'
def manage_addProperty(self, id, value, type, REQUEST=None):
"""Add a new property via the web. Sets a new property with
the given id, type, and value."""
self._wrapperCheck(value)
if type_converters.has_key(type):
value=type_converters[type](value)
self._setProperty(id, value, type)
......@@ -308,7 +303,6 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
for prop in self._properties:
name=prop['id']
value=REQUEST.get(name, '')
self._wrapperCheck(value)
self._setPropValue(name, value)
return MessageDialog(
title ='Success!',
......@@ -335,9 +329,7 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
if self.hasProperty(name):
if not 'w' in propdict[name].get('mode', 'wd'):
raise 'BadRequest', '%s cannot be changed' % name
self._wrapperCheck(value)
self._setPropValue(name, value)
if REQUEST is not None:
return MessageDialog(
title ='Success!',
......
......@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__='$Revision: 1.44 $'[11:-2]
__version__='$Revision: 1.45 $'[11:-2]
import time, string, App.Management, Globals
from ZPublisher.Converters import type_converters
......@@ -396,14 +396,6 @@ class PropertySheet(Persistent, Implicit):
" "
raise 'Redirect', URL1+'/manage'
def _wrapperCheck(self, object):
# Raise an error if object appears to be wrapped. If a
# PropertySheet implementation ever needs to store wrapped
# objects for some reason, it will need to override this
# method.
if hasattr(object, 'aq_base'):
raise ValueError, 'Invalid property value: wrapped object'
def manage_addProperty(self, id, value, type, REQUEST=None):
"""Add a new property via the web. Sets a new property with
the given id, type, and value."""
......@@ -425,7 +417,6 @@ class PropertySheet(Persistent, Implicit):
propdict=self._propdict()
for name, value in props.items():
if self.hasProperty(name):
self._wrapperCheck(value)
self._updateProperty(name, value)
if REQUEST is not None:
return MessageDialog(
......@@ -438,7 +429,6 @@ class PropertySheet(Persistent, Implicit):
for prop in self.propertyMap():
name=prop['id']
value=REQUEST.get(name, '')
self._wrapperCheck(value)
self._updateProperty(name, value)
return MessageDialog(
title ='Success!',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment