[sqlalchemy] Looking for examples of SQLAlchemy in WSGI apps

2009-07-13 Thread Matt Wilson
I'm writing a really tiny WSGI app just for fun. Right now, it looks like this: from flup.server.scgi import WSGIServer WSGIServer(s).run() The s object is the an app that dispatches to other apps based on the URL. Are there any instructions written for using SQLAlchemy in this context? I'm

[sqlalchemy] Can I write this query with SQLAlchemy?

2008-12-04 Thread Matt Wilson
Right now, I'm writing this query as a string. I want to know if it can be expressed with SQLAlchemy's expressions instead. Here's the query: select sh.employee_id, sum(st.stop_time - st.start_time) as hours from shift sh, shift_time st where sh.employee_id in (28630, 28648) and

[sqlalchemy] Re: Can I write this query with SQLAlchemy?

2008-12-04 Thread Matt Wilson
),          datetime.datetime(2008, 11, 9, 0, 0, 0)      )).\      group_by(shift.c.employee_id).\      order_by(desc(hours)) print s print s.compile().params On Dec 4, 2008, at 11:23 AM, Matt Wilson wrote: Right now, I'm writing this query as a string.  I want to know if it can be expressed