Re: [sqlalchemy] Idempotence of adding an event listener

2012-07-17 Thread Michael Bayer
Ideally it would be once, though there are implementational complexities to this.The function that is ultimately added to the list of listeners is not always the one that you passed - in the case of mapper and attribute events, the given function is more often than not wrapped in an

Re: [sqlalchemy] Custom in-query-only rendering for TypeDecorator types?

2012-07-17 Thread Russ
For future reference, it is not actually a great idea to use @compiles to render with AT TIME ZONE as I did above. When done this way, SQLAlchemy renders all references to that column using this, *including* any references in a WHERE clause. eg: when looking for log events later than some

Re: [sqlalchemy] Custom in-query-only rendering for TypeDecorator types?

2012-07-17 Thread Michael Bayer
On Jul 17, 2012, at 2:25 PM, Russ wrote: For future reference, it is not actually a great idea to use @compiles to render with AT TIME ZONE as I did above. When done this way, SQLAlchemy renders all references to that column using this, including any references in a WHERE clause. eg:

Re: [sqlalchemy] fractional second percision- mysql

2012-07-17 Thread James
I have created a feature request ticket for MySQLdb to add fractional second support: http://sourceforge.net/tracker/?func=detailaid=3545195group_id=22307atid=374935 Currently, I am still using my patched version of MySQLdb/times.py however I did notice a slight formatting issue with my

[sqlalchemy] Re: Set-based association proxy through AppenderQuery?

2012-07-17 Thread Jon Parise
I have a similar use case, and aside from introducing a duplicate non-lazy relationship to back the association_proxy, I haven't found a solution. Does anyone have a more elegant approach? On Saturday, February 11, 2012 12:15:38 PM UTC-8, Mark Friedenbach wrote: Hi, Is it possible to have

Re: [sqlalchemy] Re: Set-based association proxy through AppenderQuery?

2012-07-17 Thread Michael Bayer
association proxy documents the proxy_factory attribute for this purpose. see below. from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.associationproxy import association_proxy, _AssociationSet import operator