Hi everyone, Here's a simple question for somebody: The default add method for a ZClass I just created looks like this: <HTML> <HEAD><TITLE>Add SchoolMenuClass</TITLE></HEAD> <BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555"> <dtml-with "SchoolMenuClass.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> <dtml-if DestinationURL> <dtml-call "RESPONSE.redirect(DestinationURL+'/manage_workspace')"> <dtml-else> <dtml-call "RESPONSE.redirect(URL2+'/manage_workspace')"> </dtml-if> </body></html> This works fine, but I'd like to create an id and title based on the form input without having the user worry about the format of the text. This is a lot easier with Python than DTML. So what would be the equivalent of the above DTML Method in a PythonScript? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/ W. St. Paul, MN | | http://slashdot.org/ wilson@visi.com | <dtml-var pithy_quote> | http://linux.com/
REQUEST = context.REQUEST RESPONSE = REQUEST.RESPONSE schoolmenu = SchoolMenuClass.createInObjectManager(REQUEST['id'], REQUEST) schoolmenu.propertysheets.Basic.manage_editProperties(REQUEST) schoolmenu.reindex_object() if REQUEST.has_key(DestinationURL): return RESPONSE.redirect(DestinationURL+'/manage_workspace') return RESPONSE.redirect(URL2+'/manage_workspace') good luck :-) Chris PS: I made assumptions about what DestinationURL is and where it comes from, sorry if they're wrong...
I'm confused. I've used PythonMethods and ExternalMethods, but how do I use PythonScripts? There doesn't seem to be a pythonScript product on the zope site (if you search for 'pythonscript" you get heaps of stuff though). Is it a 2.3 thing? I think PythonScripts may be just what I want, I'd like closer integration with python but find External methods a bit cumbersome. thanks tom
participants (3)
-
Chris Withers -
Timothy Wilson -
tom smith