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
9a7d7af4
Commit
9a7d7af4
authored
Jun 19, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged ZClass id restriction from 2.2 branch
parent
c8382052
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+6
-2
No files found.
lib/python/ZClasses/ZClass.py
View file @
9a7d7af4
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
"""Zope Classes
"""Zope Classes
"""
"""
import
Globals
,
string
,
OFS
.
SimpleItem
,
OFS
.
PropertySheets
,
Products
import
Globals
,
string
,
OFS
.
SimpleItem
,
OFS
.
PropertySheets
,
Products
import
Method
,
Basic
,
Property
,
AccessControl
.
Role
import
Method
,
Basic
,
Property
,
AccessControl
.
Role
,
ts_regex
from
ZPublisher.mapply
import
mapply
from
ZPublisher.mapply
import
mapply
from
ExtensionClass
import
Base
from
ExtensionClass
import
Base
...
@@ -124,12 +124,16 @@ def dbVersionEquals(ver):
...
@@ -124,12 +124,16 @@ def dbVersionEquals(ver):
Globals
.
DatabaseVersion
==
ver
Globals
.
DatabaseVersion
==
ver
bad_id
=
ts_regex
.
compile
(
'[^a-zA-Z0-9_]'
).
search
def
manage_addZClass
(
self
,
id
,
title
=
''
,
baseclasses
=
[],
def
manage_addZClass
(
self
,
id
,
title
=
''
,
baseclasses
=
[],
meta_type
=
''
,
CreateAFactory
=
0
,
REQUEST
=
None
,
meta_type
=
''
,
CreateAFactory
=
0
,
REQUEST
=
None
,
zope_object
=
0
):
zope_object
=
0
):
"""Add a Z Class
"""Add a Z Class
"""
"""
if
bad_id
(
id
)
!=
-
1
:
raise
'Bad Request'
,
(
'The id %s is invalid as a class name.'
%
id
)
if
not
meta_type
:
meta_type
=
id
if
not
meta_type
:
meta_type
=
id
r
=
{}
r
=
{}
...
...
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