[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-10 Thread Michael Bayer
On Nov 9, 2007, at 7:16 PM, [EMAIL PROTECTED] wrote: huh? it dies here. r3727 or 3760 all the same, py2.5..., did remove all *pyc the test is committed in r3763. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-09 Thread sdobrev
one more error in ACP, took me a day to find and separate. it's very simple and very basic... ClauseAdapter does not work. -- from sqlalchemy import * from sqlalchemy.sql.util import ClauseAdapter m = MetaData() a=Table( 'a',m, Column( 'id',Integer, primary_key=True),

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-09 Thread Michael Bayer
On Nov 9, 2007, at 6:49 PM, [EMAIL PROTECTED] wrote: om sqlalchemy import * from sqlalchemy.sql.util import ClauseAdapter m = MetaData() a=Table( 'a',m, Column( 'id',Integer, primary_key=True), Column( 'xxx_id', Integer, ForeignKey( 'a.id', name='adf', use_alter=True ) ) ) e

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-09 Thread sdobrev
om sqlalchemy import * from sqlalchemy.sql.util import ClauseAdapter m = MetaData() a=Table( 'a',m, Column( 'id',Integer, primary_key=True), Column( 'xxx_id', Integer, ForeignKey( 'a.id', name='adf', use_alter=True ) ) ) e = (a.c.id == a.c.xxx_id) print e b = a.alias()

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-09 Thread Michael Bayer
On Nov 9, 2007, at 7:26 PM, Michael Bayer wrote: On Nov 9, 2007, at 6:49 PM, [EMAIL PROTECTED] wrote: om sqlalchemy import * from sqlalchemy.sql.util import ClauseAdapter m = MetaData() a=Table( 'a',m, Column( 'id',Integer, primary_key=True), Column( 'xxx_id', Integer,

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread Michael Bayer
On Nov 8, 2007, at 2:01 AM, [EMAIL PROTECTED] wrote: i dont really understand why u need the ACP being so different to plain visitor; i mean cant they share some skeleton part of traversing, while putting all the choices (visit* vs convert; onentry/onexit; stop/dont) in their own

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread Michael Bayer
On Nov 8, 2007, at 11:32 AM, svilen wrote: mmmh. u can think of splitting the Visitor into 3: Guide (who traverses _everything_ given), Visitor (who does things), and intermediate Decisor, who decides where to go / what to do. But this can get complicated (slow) although it would be quite

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread sdobrev
Michael Bayer wrote: On Nov 8, 2007, at 11:32 AM, svilen wrote: mmmh. u can think of splitting the Visitor into 3: Guide (who traverses _everything_ given), Visitor (who does things), and intermediate Decisor, who decides where to go / what to do. But this can get complicated (slow)

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread Michael Bayer
heres an entirely valid SA expression: subq = t2.select().alias('subq') s = select([t1.c.col1, subq.c.col1], from_obj=[t1, subq, t1.join(subq, t1.c.col1==subq.c.col2)]) the way the above works is, t1.join(subq) sends a message to the enclosing Select to hide t1 and subq

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread svilen
i dont really understand why u need the ACP being so different to plain visitor; i mean cant they share some skeleton part of traversing, while putting all the choices (visit* vs convert; onentry/onexit; stop/dont) in their own parts. After all, visitor pattern is twofold, a) Guide

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread sdobrev
heres the structure of: select(from_obj=[t1, t2, t1.join(t2)]) select +--- t1 -+ |--- t2 | +--- join of t1/t2 ---+ t2 and t1 both have two parents, and there are two paths to each of t1 and t2 from the head select. so its not a tree in the

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-08 Thread Michael Bayer
On Nov 8, 2007, at 2:37 PM, [EMAIL PROTECTED] wrote: heres the structure of: select(from_obj=[t1, t2, t1.join(t2)]) select +--- t1 -+ |--- t2 | +--- join of t1/t2 ---+ t2 and t1 both have two parents, and there are two paths to each of t1

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread Michael Bayer
On Nov 7, 2007, at 1:02 PM, svilen wrote: On Wednesday 07 November 2007 19:33:22 Michael Bayer wrote: ohyoure *extending* abstractclauseprocessor ??? well yes, thats going to change things quite a bit. I think you should study ACP in its current form; what its doing now is

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread svilen
On Wednesday 07 November 2007 19:33:22 Michael Bayer wrote: ohyoure *extending* abstractclauseprocessor ??? well yes, thats going to change things quite a bit. I think you should study ACP in its current form; what its doing now is faithfully calling convert_element() for *every*

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread Michael Bayer
ohyoure *extending* abstractclauseprocessor ??? well yes, thats going to change things quite a bit. I think you should study ACP in its current form; what its doing now is faithfully calling convert_element() for *every* element in the expression, and also is not copying any elements

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread Michael Bayer
On Nov 7, 2007, at 11:03 AM, svilen wrote: also, i put a class ClauseVisitor( sql_util.AbstractClauseProcessor): def convert_element( me, e): return None in the beginning of the tests.sql.generative, and after ignoreing this or that error, here is similar thing:

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread svilen
On Wednesday 07 November 2007 16:57:08 Michael Bayer wrote: On Nov 7, 2007, at 2:03 AM, [EMAIL PROTECTED] wrote: - something changed in the traversing (AbstractClauseProcessor - r3727) and it does not find proper things... ACP has been entirely rewritten. if you can provide simple

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread Michael Bayer
OK i found some more things that i think is probably screwing you up. will keep you posted. On Nov 7, 2007, at 10:45 AM, svilen wrote: On Wednesday 07 November 2007 16:57:08 Michael Bayer wrote: On Nov 7, 2007, at 2:03 AM, [EMAIL PROTECTED] wrote: - something changed in the traversing

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread Michael Bayer
On Nov 7, 2007, at 1:20 PM, svilen wrote: ahha. so i am replacing one whole subexpr with somthing, and the original subexpr is not traversed inside. if i comment the stop_on.add(), it attempts to traverse the result subexpr, not the original one. i want the original to be traversed.

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread sdobrev
ahha. so i am replacing one whole subexpr with somthing, and the original subexpr is not traversed inside. if i comment the stop_on.add(), it attempts to traverse the result subexpr, not the original one. i want the original to be traversed. Something like doing onExit instead of current

[sqlalchemy] Re: r3727 / AbstractClauseProcessor problem

2007-11-07 Thread Michael Bayer
try out r3754. On Nov 7, 2007, at 6:56 PM, Michael Bayer wrote: OK i found some more things that i think is probably screwing you up. will keep you posted. On Nov 7, 2007, at 10:45 AM, svilen wrote: On Wednesday 07 November 2007 16:57:08 Michael Bayer wrote: On Nov 7, 2007, at 2:03 AM,