SQLObject.q.foreign_keyID vs. SQLObject.q.foreign_key_ID
Rhubarb Sin <[email protected]> Fri, 14 Jun 2013 16:57:10 -0400
| Newsgroups | gmane.comp.python.sqlobject |
|---|---|
| Message-ID | <CAM04Upug7n+ZL87PbJEthUSsMoJ94+2yRVB9SP7JZLts9xwpKw@mail.gmail.com> |
I was surprised when I recently discovered I had to add an extra underscore to use a SQLObject class's foreign key ID when using sqlobject.sqlbuilder.Outer. For example, this works: EXISTS(Select(Foo.q.id, where=Outer(Bar).q.foo_ID == Foo.q.id)) This does not work: EXISTS(Select(Foo.q.id, where=AND(Outer(Bar).q.fooID == Foo.q.id))) I've posted an example as a Gist here: https://gist.github.com/RhubarbSin/5785040 (That code doesn't represent the way I would normally perform a query; I encountered the issue in a subquery of a much larger one.) ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev