MapperExtension allows you to override the select() and select_by() methods of Query, and in the trunk it also supports get_by(), get(), and load(). this would be a place to put a very coarse-grained bypass of querying in. this is something you could do pretty quickly without getting too deeply into things.
if you want your instances to be more integrated with the unit of work, that would be much more involved and im not sure if anything would really be left of the ORM once you completed it, particularly if they truly have no correlation to a table at all. MapperExtension has a lot of methods that fire off upon insert, update, delete, etc that would probably be involved. *maybe* a careful usage of those could accomplish most of the task. Youd probably want to get fairly familiar with the internals of how mapped objects are set up. this would mostly involve carefully inspecting the __dict__ of instances as they move through various persistence states, familiarizing yourself with the instances() method on Query (its been recently moved from Mapper to Query) as well as the _instance(), save_obj() and delete_obj() methods on mapper, and getting a general idea of the purpose of the attributes.py module which is something you can play with all by itself (see the attributes.py test suite in the test/ directory for examples). I would say its worth putting some thought into the motivations for putting file-based persistence behind SQLAlchemy's API, since SQLAlchemy itself is designed to be explicitly revealing of database concepts, intending to be placed behind coarser-grained persistence layers for applications that want to conceal the details of SQL database interaction. such a layer would probably be a better place to stick an abstraction between SQL and file-based persistence. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy -~----------~----~----~----~------~----~------~--~---
