Valentino Volonghi aka Dialtone ha scritto:


On Tue, 20 Feb 2007 21:44:48 +0100, Manlio Perillo <[EMAIL PROTECTED]> wrote:

I do not understand why, but childFactory is called 2 times per request.
If I replace the n:macro with a n:render, childFactory is called 3 times?

Why is this happening?

Pretty normal if you use addSlash=True while not putting an ending / at every
url.

There's no link between childFactory and macro rendering.



Just forget it!

I have a personalized locateChild in the base class, where I do:

    def locateChild(self, ctx, segments):
        request = inevow.IRequest(ctx)
        if request.args.get('login-failure'):
            import login

            return login.Login(self.avatar, failure=True), ''

        res = rend.Page.locateChild(self, ctx, segments)
        if res == rend.NotFound:
            return NotFound(self.avatar), ''

        return rend.Page.locateChild(self, ctx, segments) # <===


:-).



By the way, is this code the best way to handle a login failure?

Moreover, I still do not understand why, when replacing macro with render, locateChild is called 3 times, instead of 2.



Regards   Manlio Perillo

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to