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
4779baed
Commit
4779baed
authored
Apr 08, 1999
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made ZClasses easier to call from DTML, and documented the calling interface
a bit.
parent
f10f5ddf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+15
-11
No files found.
lib/python/ZClasses/ZClass.py
View file @
4779baed
...
...
@@ -243,27 +243,31 @@ class ZClass(OFS.SimpleItem.SimpleItem):
manage_options
=
ComputedAttribute
(
manage_options
)
def
index_html
(
self
,
id
,
REQUEST
):
"""Create Z instance
def
index_html
(
self
,
id
,
REQUEST
,
RESPONSE
=
None
):
"""
Create Z instance. If called with a RESPONSE,
the RESPONSE will be redirected to the management
screen of the new instance's parent Folder. Otherwise,
the instance will be returned.
"""
i
=
mapply
(
self
.
_zclass_
,
(),
REQUEST
)
if
not
hasattr
(
i
,
'id'
)
or
not
i
.
id
:
i
.
id
=
id
folder
=
durl
=
None
if
hasattr
(
self
,
'Destination'
):
try
:
d
=
self
.
Destination
if
d
.
im_self
.
__class__
is
FactoryDispatcher
:
folder
=
d
()
durl
=
self
.
DestinationURL
()
except
:
pass
d
=
self
.
Destination
if
d
.
im_self
.
__class__
is
FactoryDispatcher
:
folder
=
d
()
if
folder
is
None
:
folder
=
self
.
aq_parent
if
not
hasattr
(
folder
,
'_setObject'
):
folder
=
folder
.
aq_parent
folder
.
_setObject
(
id
,
i
)
if
REQUEST
.
has_key
(
'RESPONSE'
):
if
durl
is
None
:
durl
=
REQUEST
[
'URL3'
]
REQUEST
[
'RESPONSE'
].
redirect
(
durl
+
'/manage_workspace'
)
if
RESPONSE
is
not
None
:
try
:
durl
=
self
.
DestinationURL
()
except
:
durl
=
REQUEST
[
'URL3'
]
RESPONSE
.
redirect
(
durl
+
'/manage_workspace'
)
else
:
return
getattr
(
folder
,
id
)
...
...
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