On Nov 20, 2007 11:05 AM, Justin <[EMAIL PROTECTED]> wrote:
>
> Sorry, I got cut off.. Anyway, the order is as follows:
>
> 1. <my test controller>
> 2. template.TemplateController
> 3. template.TemplateController
> 4. error.ErrorController
> 5. template.TemplateController
> 6. error.ErrorController
> 7. error.ErrorController
>
> This is for a test view that just returns a simple string to the
> browser and the page is returned as is should be without error. Is
> this normal? What is the purpose of all these controller calls? Right
> now I'm just evaluating pylons but this strikes me as inefficient and
> obtuse.

Are you sure it's not making all those requests, perhaps for images or
stylesheets?  I tried what you said, putting

    print "Controller is", self.__class__.__name__

at the beginning of BaseController.__call__() in one of my
applications,  It prints the expected controller, not the extra lines.
 But if I go to a nonexistent page, I get this:

Controller is TemplateController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController
Controller is ErrorController

TemplateController is the one in your last routing rule, which matches
if no other routes have matched.  By default it always reports "404
Not Found".  This is caught by the ErrorDocuments middleware, which
makes a subrequest for the error page -- the first ErrorController
call.  The other ErrorController calls are stylesheets and images for
that page.

If you still can't figure it out, show us your controller class, any
changes you've made to the routing, and the URL you're requesting, and
maybe that will clear it up.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to