[mod_python] Objects instead of function for forms

Jean-Philippe Barrette-LaPierre jpbarrette at savoirfairelinux.net
Wed Sep 1 17:07:09 EDT 2004


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



More information about the Mod_python mailing list