[Twisted-web] Re: How work formless?
    Alberto Trujillo 
    alberto.trujillo at ucd.ie
       
    Mon Jul  4 04:50:06 MDT 2005
    
    
  
Hello Donovan:
Thank again for your help, here I send you the files. Everythings is 
working like I told you before, but I don't see the error message in the 
screen.
year.html
----------------
<form action="freeform_post!!selectYear" method="POST">
    Type a year: <input type="text" name="year" />
    <input type="submit" />
</form>
year.py
------------
from nevow import rend, loaders
import formless
class YearChooseable(formless.TypedInterface):
    def selectYear(self, year=formless.Integer()):
        pass
    selectYear = formless.autocallable(selectYear)
class Colorful(rend.Page):
    __implements__ = YearChooseable, rend.Page.__implements__
    addSlash = True
    def selectYear(self, year):
        self.test = True
#        return rend.Page.locateChild(self, context, segments)
       
    docFactory = loaders.xmlfile("year.html")
year.tac
-------------
from twisted.application import internet, service
from nevow import appserver
import year
application = service.Application("tasks")
webserver = internet.TCPServer(8080, appserver.NevowSite(year.Colorful()))
webserver.setServiceParent(application)
    
    
More information about the Twisted-web
mailing list