[sqlalchemy] Re: how to do many-to-many on the same table?

2007-04-04 Thread Sébastien LELONG
Hi, Hi, This is causing very messy code though, especially if youa re deleteing an article. Here is now i have it now. The flush is needed, or else i get an AssertionError saying SA is trying to flush 0 into a primary_key. Could you give more details ? I tried using the previous attached

[sqlalchemy] Re: how to do many-to-many on the same table?

2007-04-04 Thread Arnar Birgisson
Hi there, I haven't read the reast of the thread, but I asked a question here of how to represent a graph. What you need is essentialli an undirected graph. On 4/3/07, tml [EMAIL PROTECTED] wrote: So, if article 1 is related to article 2.. then there should be two rows in the

[sqlalchemy] Re: how to do many-to-many on the same table?

2007-04-04 Thread Arnar Birgisson
On 4/4/07, Arnar Birgisson [EMAIL PROTECTED] wrote: I often use a different technique. Instead of keeping two lines in the association table, I only keep one and make a rule that relateditem1 = relateditem2. Here is the thread on graphs where Mike posted a working solution: