[sqlalchemy] Can I restrict the set of mappers that configure_mappers() works on?

2015-04-21 Thread Steven Winfield
Hi, It seems like configuration is attempted for all new mappers, globally, whenever a query is done. So if library A and B both use sqlalchemy, and A imports B before A's mappers can be properly initialised (e.g. there is a relationship("ClassnameAsString") call somewhere that can't be resolve

Re: [sqlalchemy] Can I restrict the set of mappers that configure_mappers() works on?

2015-04-21 Thread Mike Bayer
On 4/21/15 9:31 AM, Steven Winfield wrote: Hi, It seems like configuration is attempted for all new mappers, globally, whenever a query is done. So if library A and B both use sqlalchemy, and A imports B before A's mappers can be properly initialised (e.g. there is a relationship("Classname

Re: [sqlalchemy] Can I restrict the set of mappers that configure_mappers() works on?

2015-04-21 Thread Steven Winfield
OK, thanks for the quick answer - I guess I shouldn't be using sqlalchemy for the importer then, since this necessarily has to perform queries in order for scripts to be imported. I might attempt restricting mapper configuration to a group of tables - I think the performance penalty would be qu

Re: [sqlalchemy] Can I restrict the set of mappers that configure_mappers() works on?

2015-04-21 Thread Mike Bayer
On 4/21/15 12:25 PM, Steven Winfield wrote: OK, thanks for the quick answer - I guess I shouldn't be using sqlalchemy for the importer then, since this necessarily has to perform queries in order for scripts to be imported. what's that about ? some kind of dynamic scripting environment? If

Re: [sqlalchemy] Can I restrict the set of mappers that configure_mappers() works on?

2015-04-22 Thread Steven Winfield
Sort of... it goes something like this: In some database (call it "code") there is a table - script(name text, contents text) - which is wrapped using an sqlalchemy class called Script. In our environment we fire up fresh python interpreters, import the library that defines Script, install a PEP