On Thursday 25 September 2008 15:48:59 Kirk Strauser wrote: > On Wednesday 24 September 2008 15:04:05 Christoph Zwerschke wrote: > > The documentation says it is identical with SQLAlchemy's *contextual* > > mapper function, not with the normal sqlalchemy.orm.mapper function that > > you were using here. > > Good grief. I hadn't realized there was a distinction until just then. If > anyone needs me, I'll be off RTFM for a while. > > But this does bring me to a related question. As I mentioned before, I > have a module with hundreds of SA definitions. A lot of our code runs in > strange places, like Windows , and I don't want to install TG everywhere as > another dependency. Neither do I want to duplicate all those definitions. > > It looks like I can just switch "mapper" from SA to TG depending on which I > need, but I have no idea how I could pass that information to my > definitions module so that it can initialize everything appropriately.
How about a conditional import in your model that first tries to get mapper from turbogears, and on a failing import, import the contextual_mapper? Both under the same name of course. Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

