[mod_python] Objects instead of function for forms

Ross M Karchner ross at karchner.com
Wed Sep 1 17:30:33 EDT 2004


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
>  
>



More information about the Mod_python mailing list