[Twisted-web] Getting URL

Alberto Trujillo alberto.trujillo at ucd.ie
Fri Aug 19 05:14:07 MDT 2005

Could anybody help me with this piece of code. I would like to add to 
the url the information that is placed in the line "50", but looks not 
possible. The url shoul be like the url in the line "51".

    def data_header(self, ctx, data):
        """return the content for the head of the template"""
        http_equiv = ''
        content = ''
        self.loginOK = False
        myform = ctx.arg('form')
        if (myform == 'login') and (self.executeLogin(ctx)):
            self.loginOk = True
            http_equiv = 'refresh'
            href = url.here.curdir()
            href = href.add('content', 'home')
50        #content = '3;URL=' + href
51         content = '2;URL=http://localhost:8088/'
        return {'http_equiv':http_equiv, 'content':content}

Another question.
While I'm processing the call from an url, is possible to change the 
values from the arguments? I mean, in this example I have a template 
that calls to different fragments (header, navigation, content, footer), 
the data_header method inside the template is the first one in the 
calls. Could I change here the value of one argumentin such a way that 
when the data_content method inside the template is called, this one 
receives the new value.

Thank you very much

More information about the Twisted-web mailing list