[sqlalchemy] Re: custom order by

2009-11-02 Thread Thomas Drake
That was it. Thanks for the quick response! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send ema

[sqlalchemy] Re: custom order by

2009-11-02 Thread Michael Bayer
Thomas Drake wrote: > > Is there any way to use the case() expression with a query? have you tried query.order_by(case(...)) ? > > On Oct 29, 2:26 pm, "Michael Bayer" wrote: >> ThomasDrakewrote: >> >> > Heyo, >> >> > Is there any way to specify a particular ordering on a column with the >> > o

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Michael Bayer
Tefnet Developers wrote: > > Dnia 2009-11-02, pon o godzinie 16:07 -0500, Michael Bayer pisze: > >> Providing AttributeExtension hooks to end users who can then write >> custom >> code without any attention to object/session state is never guaranteed >> to >> work completely. > > Um, that's not th

[sqlalchemy] Re: custom order by

2009-11-02 Thread Thomas Drake
And, of course, I'm taking about a Query object. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, sen

[sqlalchemy] Re: custom order by

2009-11-02 Thread Thomas Drake
Is there any way to use the case() expression with a query? On Oct 29, 2:26 pm, "Michael Bayer" wrote: > ThomasDrakewrote: > > > Heyo, > > > Is there any way to specify a particular ordering on a column with the > > order by clause (or otherwise)? Something like: > > > session.query(People).orde

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Tefnet Developers
Dnia 2009-11-02, pon o godzinie 16:07 -0500, Michael Bayer pisze: > Providing AttributeExtension hooks to end users who can then write custom > code without any attention to object/session state is never guaranteed to > work completely. Um, that's not the case. We develop the extensions ourselv

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Michael Bayer
patch added as ticket #1601 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalch

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Michael Bayer
Tefnet Developers wrote: > > Dnia 2009-11-02, pon o godzinie 11:05 -0500, Michael Bayer pisze: > >> flush what you need first. then do things that are not compatible with >> autoflush. > > The point is that I am developing a layer which attempts to hide all > sqlalchemy/relational details and pr

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Tefnet Developers
Dnia 2009-11-02, pon o godzinie 11:05 -0500, Michael Bayer pisze: > flush what you need first. then do things that are not compatible with > autoflush. The point is that I am developing a layer which attempts to hide all sqlalchemy/relational details and provide a clean and consitent API to ef

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Michael Bayer
Tefnet Developers wrote: > > Dnia 2009-10-19, pon o godzinie 18:20 -0400, Michael Bayer pisze: >> you can disable the autoflush if you say >> query.autoflush(False).whatever(). I'd start there. > > Well I need autoflush there to have current data. flush what you need first. then do things that

[sqlalchemy] Re: Better eager loading

2009-11-02 Thread Michael Bayer
Mati Skiva wrote: > Here is the query produced by SQLAlchemy: > SELECT * FROM object_markings LEFT OUTER JOIN (SELECT * FROM resources > INNER JOIN files ON resources.id = files.resource_id) AS S ON > object_markings.image_resource_id = S.id WHERE object_markings.id IN > () > > I made a tiny chang

[sqlalchemy] Re: How can i use insert/update with transactions

2009-11-02 Thread 杨晓瑜
O~~ I see Thank u~ Mike [?] 2009/10/29 Mike Conley > Looks like you are trying to mix ORM and SQL expression constructs. > Also, Insert() objects should be constructed via the insert() function. > > Try this > > conn = session.connection() # get handle to the session's connection > t = conn.b

[sqlalchemy] Re: Unsupported Type

2009-11-02 Thread Wichert Akkerman
On 11/2/09 14:04 , Sir Rawlins wrote: > > Hello Guys, > > I'm getting an exception thrown when trying to save an entity into a > SQLite database, this is a database/app which has been ported over > from a MySQL backend. > > The exception looks like this: > > InterfaceError: (InterfaceError) Error

[sqlalchemy] Unsupported Type

2009-11-02 Thread Sir Rawlins
Hello Guys, I'm getting an exception thrown when trying to save an entity into a SQLite database, this is a database/app which has been ported over from a MySQL backend. The exception looks like this: InterfaceError: (InterfaceError) Error binding parameter 0 - probably unsupported type. u'INSE

[sqlalchemy] Re: Nested transactions with SQLAlchemy and sqlite

2009-11-02 Thread Jon Black
I've also found this as well, which references the previous link: http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg15411.html 2009/11/2 Jon Black > A quick search on google revealed this: > http://74.125.77.132/search?q=cache:YB8OTfrO6xAJ:itsystementwicklung.de/pipermail/list-pysqlite/

[sqlalchemy] Re: Locking tables

2009-11-02 Thread Nathan Harmston
Hi, Thanks for that..it does seem like committing on the session causes the connection to be closed, but I can write a workaround. I m about to implement the multiple inserts changes but I thought this would be a quick bang or a small amount of effort. http://www.nevermind.co.nz/2009/10/13/s

[sqlalchemy] Re: Nested transactions with SQLAlchemy and sqlite

2009-11-02 Thread Jon Black
A quick search on google revealed this: http://74.125.77.132/search?q=cache:YB8OTfrO6xAJ:itsystementwicklung.de/pipermail/list-pysqlite/2009-June/000414.html+pipermail/list-pysqlite/2009-June/000414.html&cd=1&hl=nl&ct=clnk&gl=nl&client=firefox-a Whilst the solution doesn't help, it does mention th

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Tefnet Developers
Dnia 2009-10-19, pon o godzinie 18:20 -0400, Michael Bayer pisze: > you can disable the autoflush if you say > query.autoflush(False).whatever(). I'd start there. Well I need autoflush there to have current data. > At the same time > the AttributeExtensions are firing off in the middle of a se

[sqlalchemy] Re: Better eager loading

2009-11-02 Thread Mati Skiva
Michael Bayer wrote: > On Nov 1, 2009, at 8:10 AM, matiskiva wrote: > > >> The sql query to perform the eager loading is horrible, more horrible >> than anything i can imagine. >> > > This is certainly an exaggeration, and its always a good idea to > please tell us on the list what output

[sqlalchemy] Re: Driver Test Suite

2009-11-02 Thread Julian Scheid
One of the DBMSes I'm writing a driver for does not support SELECT statements without a FROM clause as you an see below. (This is just one of many unit tests failing with this error message.) Is there an easy way to tell SQLAlchemy to use a different statement as NOP? There's a related issue wi