[sqlalchemy] Re: Problem with clear_mapper
I can use clear_mappers() because I use mod_python and my mappers are defined during init. Is there any other way I can get this select mapped to my object? non_primary=True (see the docs on mutliple mappers for a class) But that would mean I would define a new non_primary mapper every time, wouldn't it? Is this really a good idea for a server software? Is there maybe a way to update the used table without redefining the mapper? if you are creating all kinds of select() objects from which you want to load instances, simply feed those into query.select() and the appropriate instances will be returned (or use query.instances() with the result of execute()). Thanks, that worked great. Bye, Kevin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Problem with clear_mapper
The stack before is all my classes, so the last one before is the call to class_mapper in the code I send. I had a brief look at the code: def clear_mapper(m): del mapper_registry[m.class_key] attribute_manager.reset_class_managed(m.class_) if hasattr(m.class_, 'c'): del m.class_.c m.class_key.dispose() The traceback comme form del m.class_.c. It looks to me as it tries to delete the columns from the class and fails. I didn't define a mapper without an entity_name, could that be the problem? I can use clear_mappers() because I use mod_python and my mappers are defined during init. Is there any other way I can get this select mapped to my object? Bye, Kevin Michael Bayer wrote: On Apr 25, 2007, at 6:06 PM, Kevin Schmidt wrote: clear_mapper(customMapper) Running that I get: Processing Failure c /usr/lib/python2.5/site-packages/sqlalchemy/orm/__init__.py: 110:clear_mapper] im not sure what that error means, or if thats a full stack trace (if not, a full stack would be helpful). but the clear_mapper() function is going to be generally pretty unreliable since the mapper can be involved in relationships with other mappers. (favor clear_mappers() ) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Problem with clear_mapper
On Apr 26, 2007, at 11:42 AM, Kevin Schmidt wrote: The traceback comme form del m.class_.c. It looks to me as it tries to delete the columns from the class and fails. I didn't define a mapper without an entity_name, could that be the problem? i dont really know. id rather just remove the function from SA altogether. I can use clear_mappers() because I use mod_python and my mappers are defined during init. Is there any other way I can get this select mapped to my object? non_primary=True (see the docs on mutliple mappers for a class) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Problem with clear_mapper
I can use clear_mappers() because I use mod_python and my mappers are defined during init. Is there any other way I can get this select mapped to my object? non_primary=True (see the docs on mutliple mappers for a class) But that would mean I would define a new non_primary mapper every time, wouldn't it? Is this really a good idea for a server software? Is there maybe a way to update the used table without redefining the mapper? Bye, Kevin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Problem with clear_mapper
On Apr 25, 2007, at 6:06 PM, Kevin Schmidt wrote: clear_mapper(customMapper) Running that I get: Processing Failure c /usr/lib/python2.5/site-packages/sqlalchemy/orm/__init__.py: 110:clear_mapper] im not sure what that error means, or if thats a full stack trace (if not, a full stack would be helpful). but the clear_mapper() function is going to be generally pretty unreliable since the mapper can be involved in relationships with other mappers. (favor clear_mappers() ) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---