<html>
Thanx to the dude who answered my last post :)<br>
When i get some time i have to try and put into practive wxpython
suggestions<br><br>
I took the form processor example from the sandbox and made it do
something.<br>
What it is doing i am not quite sure :)<br><br>
#form_input.py<br>
#simple proggie to test how to handle forms<br>
#hacked together from myformstuf which is in the glyph directory in the
sandbox<br>
#not really sure if this is done right<br><br>
from twisted.web.woven import page<br>
#this module is required for the method def wmfactory_form(self,
request): to work<br>
from twisted.web.woven.form import FormProcessor<br>
from twisted.python import formmethod as fm<br><br>
class FormPage(page.Page) :<br><br>
&nbsp;&nbsp;&nbsp; template = '''<br>
&nbsp;&nbsp;&nbsp; &lt;html&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;head&gt;&lt;title&gt;a form
page&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/head&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;body&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;form action=&quot;post&quot;
model=&quot;form&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/html&gt;<br>
&nbsp;&nbsp;&nbsp; '''<br><br>
&nbsp;&nbsp;&nbsp; formSignature = fm.MethodSignature(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fm.String(&quot;username&quot;,&quot;&quot;,&quot;User Name :
&quot;,&quot;Enter a user name&quot;),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fm.Password(&quot;password&quot;,&quot;&quot;,&quot;Password :
&quot;,&quot;Enter a password&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; def proc(self,**kw) :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;proc :
&quot;,kw<br><br>
&nbsp;&nbsp;&nbsp; def wmfactory_form(self, request):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;factory
form&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
self.formSignature.method(self.proc)<br><br>
&nbsp;&nbsp;&nbsp; def wchild_post(self,request) :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;child post
&quot;,request.args<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
FormProcessor(self.formSignature.method(self.proc))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>
<br>
#the test throttle code<br>
def main() :<br>
&nbsp;&nbsp;&nbsp; print &quot;Main Loop&quot;<br>
&nbsp;&nbsp;&nbsp; from twisted.web.server import Site<br>
&nbsp;&nbsp;&nbsp; from twisted.internet import reactor<br><br>
&nbsp;&nbsp;&nbsp; reactor.listenTCP(9999,Site(FormPage()))<br>
&nbsp;&nbsp;&nbsp; reactor.run()<br><br>
main()<br><br>
self.proc is a required arguement.<br>
It returns a dictionary with all the form variables in it when form is
posted. <br>
I am not really sure what am i supposed to do in this function. Like in
this instance<br>
would this be where i could stick variables into a data base ?<br><br>
The method FormProcessor(self.formSignature.method(self.proc)) appears
from the code<br>
to be able to take a second arguement where i can add my own view. If no
view is added<br>
it uses the view that is provided by default. It would be kinda nice to
have my own view,<br>
how would my own view be able to access the variables that are posted
from the form.<br><br>
FormProcessor also appears to be able to take a 3rd arguement that is
some sort of error view,<br>
what type of errors would happen, and how will they be
triggered.<br><br>
FormProcessor looks like the smart way to handle forms. Unfortunately I
seem to be missing a few pieces.<br><br>
Well i will keep on plugging away at it :)<br>
Hmmmm well anyways i am kinda lost i will think about being lost some
more :))<br><br>
<br>
Thanx<br><br>
</html>