[z3-checkins] r18706 - z3/sqlos/trunk

andres at codespeak.net andres at codespeak.net
Mon Oct 17 11:27:15 CEST 2005


Author: andres
Date: Mon Oct 17 11:27:14 2005
New Revision: 18706

Modified:
   z3/sqlos/trunk/metaconfigure.py
Log:
Cleaned this up a bit (removed auto-mixing-in of SQLOS) as its not proven to work, and not really needed.

Modified: z3/sqlos/trunk/metaconfigure.py
==============================================================================
--- z3/sqlos/trunk/metaconfigure.py	(original)
+++ z3/sqlos/trunk/metaconfigure.py	Mon Oct 17 11:27:14 2005
@@ -36,36 +36,6 @@
     if isinstance(component, basestring):
         component = _context.resolve(component)
 
-    # If the class doesn't mix-in SQLOS, we do it for you, so that you
-    # can use pure SQLObject classes, and they behave accordingly when
-    # inside Zope3.
-    # However, we issue a warning as this may have unknown side-effects.
-    if not issubclass(component, sqlos.SQLOS):
-        m_name = component.__module__
-        c_name = component.__name__
-        c_dict = dict(vars(component))
-        warnings.warn("You forgot to subclass sqlos.SQLOS on "
-                      "the registered factory %s.%s. We are "
-                      "going to try to fix this, but this has "
-                      "unknown side-effects and may break in the future. "
-                      "Please fix this as soon as possible." %
-                      (m_name, c_name),
-                      Warning, 1)
-        # XXX instead of creating a new class, we could try to modify
-        # the existingclass inplace by injecting our overriden stuff
-        # on SQLOS into the component __dict__.
-        # XXX Im not sure, if I changed that the right way. Or, more
-        # accurately Im sure that its not done the right way, because
-        #the verifyClass() test some lines down failes. But, anything
-        #works, so i dont know whats wrong.
-        # Andres Freunt - 2005-10-14
-        component = Declarative(component.__name__,
-                                  (sqlos.SQLOS, component),
-                                  c_dict)
-        # **Warning**: Monkeypatch ahead.
-        module = sys.modules[m_name]
-        setattr(module, c_name, component)
-
     factoryObj = SQLObjectFactory(component, title, description)
 
     # XXX We compute a permission name from the package top-level name


More information about the z3-checkins mailing list