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
ec64a204
Commit
ec64a204
authored
Jun 16, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed finding of base classes again :)
parent
86cc67d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+17
-6
No files found.
lib/python/ZClasses/ZClass.py
View file @
ec64a204
...
...
@@ -102,6 +102,21 @@ manage_addZClassForm=Globals.HTMLFile(
'addZClass'
,
globals
(),
default_class_
=
'OFS.SimpleItem Item'
,
CreateFactory
=
1
)
def
find_class
(
ob
,
name
):
# Walk up the aq hierarchy, looking for a ZClass
# with the given name.
while
1
:
if
hasattr
(
ob
,
name
):
return
getattr
(
ob
,
name
)
elif
hasattr
(
ob
,
'_getOb'
):
try
:
return
ob
.
_getOb
(
name
)
except
:
pass
if
hasattr
(
ob
,
'aq_parent'
):
ob
=
ob
.
aq_parent
continue
raise
AttributeError
,
name
def
manage_addZClass
(
self
,
id
,
title
=
''
,
baseclasses
=
[],
meta_type
=
''
,
CreateFactory
=
0
,
REQUEST
=
None
):
"""Add a Z Class
...
...
@@ -110,13 +125,9 @@ def manage_addZClass(self, id, title='', baseclasses=[],
for
b
in
baseclasses
:
if
Products
.
meta_classes
.
has_key
(
b
):
bases
.
append
(
Products
.
meta_classes
[
b
])
elif
hasattr
(
self
,
b
):
bases
.
append
(
getattr
(
self
,
b
))
else
:
# If self is the "methods" propertysheet
# of a ZClass, get the class from the
# propertysheet.
bases
.
append
(
self
.
_getOb
(
b
))
base
=
find_class
(
self
,
b
)
bases
.
append
(
base
)
Z
=
ZClass
(
id
,
title
,
bases
)
...
...
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