[Zope] Trying to implement a simple mvc or how do you pass th e REQUEST o bject when doing a redirect?

Pierce, Scott Scott.Pierce@Sonopress.com
Thu, 25 Jul 2002 16:27:46 -0400


Thanks.  I had actually already fixed it because they wouldn't execute
properly without them.

Scott

-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Thursday, July 25, 2002 3:13 PM
To: Pierce, Scott
Cc: 'zope@zope.org'
Subject: Re: [Zope] Trying to implement a simple mvc or how do you pass
the REQUEST o bject when doing a redirect?


Pierce, Scott writes:
 > I have a product that I am attempting to do something like this:
 > 
 >     def controller(self):
 >         """ 
 >         This will implement a MVC type paradigm for user administration.
 >         """
 >         req = self.REQUEST
 >         f = req.form
 > 
 >         controldict = {'adduser': self.CreateUser,
 >                         'viewuser': self.ViewUser,
 >                         'edituser': self.EditUser,
 >                         'None': MessageDialog(title='Error: Action not
 > Recognized',
 >                                             message='The action you took
is
 > not recognized',
 >                                             action='Admin')}
 > 
 >         controldict[f.get('controlaction','None')]()  
 > 
 > It would work except calling the dtml method like this causes there to be
no
 > traverse_subpath in the 
You should *NEVER* call DTML objects without its two positional arguments.
Read "Calling DTML objects" in 

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>




Dieter