Hello, I changed my baseclass to Inherit from object and made it as a new class.
Now it dies in trying to find hierarchy for built-in class exception.Exception. AttributeError: class Exception has no attribute '__subclasses__' In Py 2.5, Exceptions have been changed to new style classes, but it doesn't seem to be so in py 2.4. Is there a way to bypass this assumption of SA? Thanks, Harish On Wed, Aug 20, 2008 at 4:02 PM, <[EMAIL PROTECTED]> wrote: > > seems your baseclass is oldstyle class, not inheriting 'object'. > python 2.5 newstyle classes (off object) has that __subclasses__() > classmethod (see dir(type)), not sure if 2.4 has that at all. > i've no idea where these are explained (as well as mro() and other > type' stuff.) > > > i looked a bit at the src and i have a may be related question: > why, once a instrumentation (descriptor) is installed on some class X > attribute xyz, the same descriptor has to be installed on all > subclasses of it? > getattr( some_subclass_of_X, 'xyz') would return it anyway? > > if it is to allow diff subclasses to have diff. instrumentation, why > it has to be triggered by the base class and not by mapper? > and if that is because the subclass may have no mapper... what it has > to do with SA then? > > On Wednesday 20 August 2008 12:39:15 Harish K Vishwanath wrote: > > Hello, > > > > I was using elixir 0.5.2 (SQL Alchemy 0.4.6) on Py 2.4. > > > > All my model objects inherits from Entity as well as another > > baseobject specific to our application. > > > > class User(elixir.Entity, application.baseobject): > > ... > > ... > > > > It used to work fine. > > > > Today I upgraded to SQLA 0.5 beta3 and elixir 0.6.1. The same code > > doesn't work anymore. > > > > > > File "c:\Python24\lib\site- > > packages\elixir-0.6.1-py2.4.egg\elixir\entity.py", > > line 816, in setup_entities > > File > > "c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity > >.py", line 409, in setup_mapper > > File > > "c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla > >lchemy \orm\__init__.py", line 623, in mapper > > return Mapper(class_, local_table, *args, **params) > > File > > "c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla > >lchemy \orm\mapper.py", line 196, in __init__ > > self.__compile_class() > > File > > "c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla > >lchemy \orm\mapper.py", line 844, in __compile_class > > manager = attributes.create_manager_for_cls(self.class_) > > File > > "c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla > >lchemy \orm\attributes.py", line 1498, in create_manager_for_cls > > existing_factories = collect_management_factories_for(class_) > > File > > "c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla > >lchemy \orm\attributes.py", line 1604, in > > collect_management_factories_for hierarchy = > > util.class_hierarchy(cls) > > File > > "c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla > >lchemy \util.py", line 408, in class_hierarchy > > for s in [_ for _ in c.__subclasses__() if _ not in hier]: > > AttributeError: class IRObject has no attribute '__subclasses__' > > > > IRObject is our app specific base class. > > > > Any ideas? > > Thanks, > > Harish > > > > > > > > > -- Regards, Harish --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---