OK, well theres not too much of a bug here, except that when ActiveMapper has a circular relationship between two classes (comprised of more than one relationship(), that is), it fails to set up the relationships on either class. theres no immediate fix for this; while the compilation of plain (non-Active) mappers is able to handle a circular relationship like that, the way activemapper compiles on top of it is not quite as flexible. jonathan and i had talked about a way to add some extra string-based argument capabilities to Mapper/relation() so that a lot more of the compilation code in ActiveMapper could just be removed which would probably eliminate this issue. however, the reason its not super-critical is because this relationship is a backref relationship, which means youre only supposed to set it up on one class, where "backref" handles the other direction: class foo(activemapper.ActiveMapper): class mapping: name = column(String(30)) class baz(activemapper.ActiveMapper): class mapping: name = column(String(30)) foorel = many_to_many("foo", secondarytable, backref='bazrel') additionally, i removed the extra "tometadata" call on "secondarytable" since its not needed, and also re-loaded foo1/baz1 after the session.clear() since it better tests the relatoinship and also foo1/baz1 cant be connected together outside of a session because theres a lazy loader on each that needs to be fired off (play around with it and youll see what i mean). anyway, the working test added to activemapper.py in rev 1767...thanks for the convenient format. On Aug 6, 2006, at 5:40 PM, Graham Higgins wrote:
|
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users