[sqlalchemy] Re: Help convert my SQL query to SQLAlchemy

2009-09-07 Thread Michael Bayer
when I run it i get the correct: SELECT content.modulename AS content_modulename, content.revision_id AS content_revision_id, content.content AS content_content FROM content WHERE content.revision_id IN (SELECT max(content.revision_id) AS max_1 FROM content GROUP BY content.modulename) AND

[sqlalchemy] Re: Help on Custom Type with TypeEngine (Oracle SDO_GEOM)

2009-09-07 Thread Michael Bayer
SQL expressions can't be called from within the bind processor of types. The bind processor only affects the values sent as parameters to the DBAPI execute() and executemany() functions.There is a feature request that is as yet unimplemented to provide this feature, however. An

[sqlalchemy] How to avoid attribute refresh?

2009-09-07 Thread Eloff
Hi All, Have a look at this traceback, entry.value is a Site object returned from a query, accessing id (5 lines from the bottom) seems to trigger an attribute refresh. Obviously this defeats the point of the caching I'm doing. If I avoid any of the relations on the Site object, for read-only

[sqlalchemy] Re: Optimal table design for SQLAlchemy (Or One-to-many tables vs meta tables)

2009-09-07 Thread Michael Bayer
On Sep 7, 2009, at 3:27 PM, Paul Nesbit wrote: Hi, I'm in the process of setting up SQLAlchemy classes after having defined my database tables. I'm at the point where I'm mapping relationships, and I've realized now that I may have designed my tables in a sub-optimal way, or in a

[sqlalchemy] How to use julianday for datetime storing with sqlite

2009-09-07 Thread Slava Tutushkin
Hi all, I'm wondering if it's possible to make sqlalchemy using julianday for datetime storing with sqlite instead of ISO string representation. Is it possible to customize from the userland code? Thanks, Slava. --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: How to use julianday for datetime storing with sqlite

2009-09-07 Thread Michael Bayer
On Sep 7, 2009, at 7:15 PM, Slava Tutushkin wrote: Hi all, I'm wondering if it's possible to make sqlalchemy using julianday for datetime storing with sqlite instead of ISO string representation. Is it possible to customize from the userland code? if you're looking to change the actual

[sqlalchemy] Re: How to avoid attribute refresh?

2009-09-07 Thread Eloff
On Sep 7, 3:11 pm, Michael Bayer mike...@zzzcomputing.com wrote: you want to make sure things are cached (which means they've been   pickled and therefore not related to the Session anymore) before the   Session is expired, which happens when you call rollback() or commit()   (or expunged,

[sqlalchemy] How to bypass scoped_session?

2009-09-07 Thread Eloff
Hi, I'm using scoped_session in my pylons app, but sometimes I have a need to create a local session, do a little work, and commit it without worrying about the current state of the scoped_session (i.e. without committing it) I'm having some issues with that because the minute I create a new