[Zope] [Bug] refresh does not work for products initialized in the old style

Dieter Maurer dieter@handshake.de
Wed, 27 Feb 2002 20:32:23 +0100


Sven Rudolph writes:
 > ....
 > > Upgrading to new style initialization works around the problem.
 > Well, I don't think I understood your explanation. What is the difference between "old style" and "new style initialization"?

That's old style product initialization (in "__init__.py"):

	import sys, string
	import DA
	import SQLRelay
	classes=DA.classes
	meta_types=DA.meta_types
	methods=DA.folder_methods
	misc_=DA.misc_
	__ac_permissions__=DA.__ac_permissions__


That's the same in new style:

	import sys, string
	import DA
	import SQLRelay
	misc_=DA.misc_
	
	def initialize(context):
	  context.registerClass(
	    DA.classes[0],
	    meta_type=DA.meta_types[0]['name'],
	    constructors= (DA.folder_methods['manage_addZSQLRelayConnectionForm'],
	                   DA.folder_methods['manage_addZSQLRelayConnection'],),
	    permission= DA.__ac_permissions__[0][0],
	    )


Remark:

   When the product is designed for new style initialization, the
   initialization will look a bit clearer than in the above example
   where old style was forced into new style.


Dieter