opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OpenTAL-checkins] opental/PlacelessTranslationService __init__.py


From: Fernando Lalo Martins
Subject: [OpenTAL-checkins] opental/PlacelessTranslationService __init__.py
Date: Tue, 05 Aug 2003 11:53:16 -0400

CVSROOT:        /cvsroot/opental
Module name:    opental
Branch:         
Changes by:     Fernando Lalo Martins <address@hidden>  03/08/05 11:53:16

Modified files:
        PlacelessTranslationService: __init__.py 

Log message:
        ok, this one is hard to explain :-)
        
        a reference to the PTS instance is stored as a module global here and in
        PageTemplates.GlobalTranslationService.  But since this is a persistent
        object, what we actually store is a wrapper with the OID and a reference
        to the connection object.
        
        Problem is, calling Zope.app() creates a new connection - not the same 
one
        used by ZPublisher.  Since caches are per-connection, this means when 
you
        update the translation service via ZMI, your changes wouldn't be 
reflected
        in the global reference until the next restart.
        
        This change makes it instead store a wrapper that uses the same 
connection
        as the Publisher, therefore caching properly.
        
        (whoa... explanation 15 times the size of the change ;-))

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/PlacelessTranslationService/__init__.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: opental/PlacelessTranslationService/__init__.py
diff -u opental/PlacelessTranslationService/__init__.py:1.12 
opental/PlacelessTranslationService/__init__.py:1.13
--- opental/PlacelessTranslationService/__init__.py:1.12        Tue Jul 29 
18:31:28 2003
+++ opental/PlacelessTranslationService/__init__.py     Tue Aug  5 11:53:15 2003
@@ -16,7 +16,7 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
 __version__ = '''
-$Id: __init__.py,v 1.12 2003/07/29 22:31:28 lalo Exp $
+$Id: __init__.py,v 1.13 2003/08/05 15:53:15 lalo Exp $
 '''.strip()
 
 from OFS.Application import get_products
@@ -68,7 +68,7 @@
     from Products import PlacelessTranslationService as pkg
 
     # hook into the Control Panel
-    cp = Zope.app().Control_Panel
+    cp = context._ProductContext__app.Control_Panel # argh
     if cp_id not in cp.objectIds():
         make_translation_service(cp)
     pkg.translation_service = getattr(cp, cp_id)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]