[sqlalchemy] max() with SQLAlchemy 0.4.7

2011-10-11 Thread Jakob L.
Sorry if this has already been posted but couldn't find any docs for 0.4 nor any examples where columns aren't used in the query. As I understand, you can't use columns in queries in 0.4. So how should I write: session.query(Media.id, func.max(Media.sort_order)).first() -- You received

Re: [sqlalchemy] max() with SQLAlchemy 0.4.7

2011-10-11 Thread Michael Bayer
you'd use a select() construct in conjunction with Session.execute(). the current tutorial is mostly the same for 0.4: http://www.sqlalchemy.org/docs/core/tutorial.html#selecting On Oct 11, 2011, at 10:45 AM, Jakob L. wrote: Sorry if this has already been posted but couldn't find any docs

Re: [sqlalchemy] max() with SQLAlchemy 0.4.7

2011-10-11 Thread Jakob L.
select([func.max(Media.c.sort_order)]) works great! Thanx! //J -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/CtRlzNOa1DUJ. To post to this group, send