Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1f20a470
Commit
1f20a470
authored
Jan 23, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged from 2.3. branch
parent
aaa1e162
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
18 deletions
+6
-18
lib/python/OFS/PropertyManager.py
lib/python/OFS/PropertyManager.py
+3
-7
lib/python/OFS/PropertySheets.py
lib/python/OFS/PropertySheets.py
+3
-11
No files found.
lib/python/OFS/PropertyManager.py
View file @
1f20a470
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property management"""
__version__
=
'$Revision: 1.3
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
import
ExtensionClass
,
Globals
import
ZDOM
...
...
@@ -195,8 +195,8 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
propertysheets
=
vps
(
DefaultPropertySheets
)
def
valid_property_id
(
self
,
id
):
if
not
id
or
id
[:
1
]
==
'_'
or
(
' '
in
id
)
\
or
hasattr
(
aq_base
(
self
),
id
):
if
not
id
or
id
[:
1
]
==
'_'
or
(
id
[:
3
]
==
'aq_'
)
\
or
(
' '
in
id
)
or
hasattr
(
aq_base
(
self
),
id
):
return
0
return
1
...
...
@@ -243,10 +243,6 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
if
not
self
.
valid_property_id
(
id
):
raise
'Bad Request'
,
'Invalid or duplicate property id'
# Perform additional validation checks for security.
from
ObjectManager
import
checkValidId
checkValidId
(
self
,
id
)
if
type
in
(
'selection'
,
'multiple selection'
):
if
not
hasattr
(
self
,
value
):
raise
'Bad Request'
,
'No select variable %s'
%
value
...
...
lib/python/OFS/PropertySheets.py
View file @
1f20a470
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__
=
'$Revision: 1.6
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
4
$'
[
11
:
-
2
]
import
time
,
string
,
App
.
Management
,
Globals
from
ZPublisher.Converters
import
type_converters
...
...
@@ -205,12 +205,8 @@ class PropertySheet(Traversable, Persistent, Implicit):
return
self
.
v_self
()
def
valid_property_id
(
self
,
id
):
"""Is the given id valid to use as a property id
Note that this method does not consider
factors other than the actual value of the id, such as
whether the given id is already in use."""
if
not
id
or
(
id
[:
1
]
==
'_'
)
or
(
' '
in
id
):
if
not
id
or
id
[:
1
]
==
'_'
or
(
id
[:
3
]
==
'aq_'
)
\
or
(
' '
in
id
):
return
0
return
1
...
...
@@ -251,10 +247,6 @@ class PropertySheet(Traversable, Persistent, Implicit):
if
not
self
.
valid_property_id
(
id
):
raise
'Bad Request'
,
'Invalid property id, %s.'
%
id
# Perform additional validation checks for security.
from
ObjectManager
import
checkValidId
checkValidId
(
self
,
id
)
if
not
self
.
property_extensible_schema__
():
raise
'Bad Request'
,
(
'Properties cannot be added to this property sheet'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment