Re: Calling handlers manually

"Jonathan Ellis" <[email protected]>
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
On Thu, 22 Dec 2005 14:35:31 -0700, "Conan C. Albrecht"
<conan-RXmsyT/Szrj2fBVCVOL8/[email protected]> said:
> I need to call a form handler manually.  Specifically, I'm sending a  
> verification email to users, and I'd like to call a handler as if it  
> had come from a <f:form> handler.  (I want it to come from either an  
> email click OR from a regular <f:form> form).
> 
> What is the "right" way to do this?

Since handlers are meant to integrate into a specific form, it may be
the wrong level of re-use here.  (Specifically, the plumbing that makes
it possible for a chain of multiple handlers to be invoked from one
submit makes manually forging a handler-aware submit error-prone.)

One possibility is to send the email to users with just a link to your
normal form, with values pre-filled-in, and let them hit submit. 
Otherwise, I think wrapping your handler functionality in a class or
function and using that in both actions is the way to go.

-Jonathan
-- 
C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.