this is issue https://bitbucket.org/zzzeek/sqlalchemy/issue/3300/create_lazy_clause-is-only-turning-a which is fixed for master and 0.9.9. Please confirm git master and/or rel_0_9 tag works now, thanks!
Michael Bayer <[email protected]> wrote: > this is likely a bug. I’m looking into it. Might be fixed today. > > > > Demetrio Girardi <[email protected]> wrote: > >> I am trying to define a relationship that self-joins multiple columns on IS >> NOT DISTINCT FROM. Since the backend I use does not support it, I mimic it >> like this: >> >> - notdistinct = lambda a, b: ~((a != b) | (a == None) | (b == None)) | ((a >> == None) & (b == None)) >> - rel = relationship('Table', >> - primaryjoin=lambda: >> and_(notdistinct(Table.attr, foreign(remote(Table.attr))), >> - # >> ...the same for several multiple attributes... >> - )) >> >> This works fine when when joining, but the lazy loading generates SQL like >> this: >> - WHERE >> - NOT ("Table"."attr" != ? OR "Table"."attr" IS NULL OR >> "Table"."attr" IS NULL) OR >> - ("Table"."attr" IS NULL AND "Table"."attr" IS NULL) >> - .... >> >> Which is incorrect. Is there a way to help sqlalchemy identify where it >> should substitute the parent key when it appears more than once? >> >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/sqlalchemy. >> For more options, visit https://groups.google.com/d/optout. > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
