On Jun 12, 2013, at 8:46 PM, Andy <aml...@gmail.com> wrote: > I just got really confused. I have code that does > ...join(schema.MappedClass.relation), and it works. But I had other code > that did foo = schema.MappedClass.relation, and it didn't work because > 'relation' wasn't there. > > The fix is to call orm.configure_mappers(), which happens by magic at various > points. Perhaps mapped classes should have a __getattr__ that calls > configure_mappers.
We can't, because end-user configuration of mappers, relationship() and column_property() makes great use of class-bound attributes as standalone arguments as well as for composition of SQL constructs, all of which occurs as mappers are being constructed so before configure_mappers() can be called safely. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.