[mod_python] Objects instead of function for forms

jpbarrette at savoirfairelinux.net jpbarrette at savoirfairelinux.net
Wed Sep 1 21:15:12 EDT 2004


I mean that the publisher should instantiate a object of class MyAction  
with all arguments in his constructor and it will get his printable string 
by calling the str() function on the instance. 
 
-- 
Open WebMail Project (http://openwebmail.org) 
 
 
---------- Original Message ----------- 
From: Ross M Karchner <ross at karchner.com> 
To: mod_python user mailing list <mod_python at modpython.org> 
Sent: Wed, 01 Sep 2004 16:30:33 -0400 
Subject: Re: [mod_python] Objects instead of function for forms 
 
> I'm pretty sure you want to reference an object, and not a class? 
>  
> Jean-Philippe Barrette-LaPierre wrote: 
>  
> >I checked on the publisher module to see if there's a way to set objects 
to  
> >handle requests instead of functions and I didn't really understood how 
it's  
> >supposed to work. 
> > 
> >I wanted to have something like this: 
> > 
> > 
> >----------- form.py ----------- 
> >class Action: 
> >   def __init__(self): 
> >      """Special handling get there""" 
> > 
> >   def __str__(self): 
> >      return "This is an action" 
> > 
> > 
> >class MyAction(Action): 
> >   def __init__(self): 
> >      Action.__init__(self) 
> > 
> >   def __str__(self): 
> >       return "This is my action" 
> >----------- form.py ----------- 
> > 
> > 
> >There's the HTML form: 
> > 
> >-------------- 
> ><form action="form/MyAction" method="POST"> 
> >        <input type="text" name="customer[test]"/> 
> >        <input type="submit"/> 
> ></form> 
> >------------- 
> > 
> > 
> >The only thing It outputs is the name of module and class: 
> > 
> >form.MyAction 
> >	 
> > 
> >Does mod_python do that in purpose, or can I submit some code that will 
handle  
> >this in the publisher? 
> > 
> >--- 
> >Jean-Philippe Barrette-LaPierre 
> >Maintener of cURLpp 
> > 
> >_______________________________________________ 
> >Mod_python mailing list 
> >Mod_python at modpython.org 
> >http://mailman.modpython.org/mailman/listinfo/mod_python 
> >   
> > 
>  
> _______________________________________________ 
> Mod_python mailing list 
> Mod_python at modpython.org 
> http://mailman.modpython.org/mailman/listinfo/mod_python 
------- End of Original Message ------- 
 


More information about the Mod_python mailing list