What kind of errors were you getting when we didn't re-instantiate on
each request?

I'd like to be able to keep the root controller object around, but I
agree it's not worth it at this point.  (However, if we're doing this,
I'm tempted to go back to the *route way and just re-use the pylons
app entirely).   That way people with large projects could mitigate
the impact of this by using routes to break up their object trees into
much smaller entities.

--Mark Ramm

---------- Forwarded message ----------
From:  <[EMAIL PROTECTED]>
Date: Jan 22, 2008 5:52 PM
Subject: [turbogears-commits] r4026 - trunk/tg
To: [EMAIL PROTECTED]



Author: cleverdevil
Date: Tue Jan 22 16:52:18 2008
New Revision: 4026
URL: http://trac.turbogears.org/changeset/4026

Log:
Added some comments to clarify the last checkin in the code itself,
since it may be difficult to understand why this is necessary.

Modified:
   trunk/tg/__init__.py

Modified: trunk/tg/__init__.py
==============================================================================
--- trunk/tg/__init__.py        (original)
+++ trunk/tg/__init__.py        Tue Jan 22 16:52:18 2008
@@ -68,7 +68,10 @@
                 paste.registry.restorer.save_registry_state(environ)
                 start_response('200 OK', [('Content-type', 'text/plain')])
                 return ['%s' % paste.registry.restorer.get_request_id(environ)]
-
+
+        # Pylons expects fresh instances of the controller on every request,
+        # so instantiate a new instance of the root controller, and let it
+        # handle the request.
         return self.root.__class__()(environ, start_response)





-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to