> I dont have any code for this. Isn't that what a many-many relation is > supposed to do? many-to-many relation says "Article can have one or more ArticleRelated, and ArticleRelated can have one or more Article". You just declare the cardinality. You don't declare the direction. This is done while:
c = ArticleRelatedArticle(article_id=a.id, related_id=b.id) a.related.append(c) > My problem is, if only one row is added, like 1=>2... > A1.related will have A2 as an object, but A2.related is empty. how do > i make it both ways?? Well you should declare it in your code. Something like: c = ArticleRelatedArticle(article_id=a.id, related_id=b.id) # a => b d = ArticleRelatedArticle(article_id=b.id, related_id=a.id) # b => a a.related.append(c) b.related.append(d) Hope it helps. Cheers. Seb -- Sébastien LELONG http://www.sirloon.net sebastien.lelong[at]sirloon.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---