]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
__init__ monkeypatch looks for __init__ in the class' dict rather than via getattr...
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Feb 2006 19:16:34 +0000 (19:16 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Feb 2006 19:16:34 +0000 (19:16 +0000)
lib/sqlalchemy/mapping/mapper.py

index 4516ae7b365b4ef86727d08289029284c4be323e..eb54e0301d43a94cc5832231f45d39b9bc01c619 100644 (file)
@@ -212,7 +212,7 @@ class Mapper(object):
         """sets up our classes' overridden __init__ method, this mappers hash key as its
         '_mapper' property, and our columns as its 'c' property.  if the class already had a
         mapper, the old __init__ method is kept the same."""
-        if not hasattr(self.class_, '_mapper'):
+        if not self.class_.__dict__.has_key('_mapper'):
             oldinit = self.class_.__init__
             def init(self, *args, **kwargs):
                 nohist = kwargs.pop('_mapper_nohistory', False)