[sqlalchemy] Python 3.4 Enum type

2013-08-06 Thread Ian Kelly
Since Python 3.4 is adding support for enums to the standard library, I wrote a TypeDecorator for it: import sqlalchemy.types as types class PythonEnum(types.TypeDecorator): impl = types.Enum def __init__(self, enum_class, **kw): super().__init__(*(m.name for m in enum_class),

Re: [sqlalchemy] Tea Rota

2012-01-13 Thread Ian Kelly
On Thu, Jan 12, 2012 at 3:14 PM, Calum MacLeod pan...@sky.com wrote:     if date not in duties:     duty = Duty(date=date)     duties[date] = duty     if name not in volunteers:     volunteer = Volunteer(fore=fore, surn=surn, name=name)     volunteers[name] = volunteer    

Re: [sqlalchemy] Oracle Connection Oddities

2011-07-14 Thread Ian Kelly
On Thu, Jul 14, 2011 at 12:53 PM, Burhan burhan.kha...@gmail.com wrote: I am not sure what version of cx_Oracle it is - it was downloaded as a Windows binary - the latest version is 5.1 on the cx_Oracle download page. import cx_Oracle print cx_Oracle.version -- You received this message

Re: [sqlalchemy] group by and Oracle

2010-12-03 Thread Ian Kelly
On Fri, Dec 3, 2010 at 4:08 AM, jo jose.soa...@sferacarta.com wrote: Hi all, I'm trying to write a GROUP BY query grouped by a function (to_char) using a variable format, which could be 'yy' or '' as in: sql=session.query(   func.to_char(Prestazione.c.data,format),  

Re: [sqlalchemy] new LIMIT/OFFSET Support for oracle - huge speed penalty

2010-06-23 Thread Ian Kelly
On Wed, Jun 23, 2010 at 1:50 AM, Ralph Heinkel ralph.hein...@web.de wrote: Hi, we are about upgrading our sqlalchemy library from 0.4.8 to something newer and during this process we have detected that the LIMIT/OFFSET support for oracle has been changed, from using  “ROW NUMBER OVER...” to a

Re: [sqlalchemy] Re: use_ansi oracle sysdate vs. current_date

2010-04-02 Thread Ian Kelly
On Fri, Apr 2, 2010 at 3:41 PM, Michael Bayer mike...@zzzcomputing.comwrote: Kent wrote: Along the same lines, is there something we can do about nvl() (oracle) versus coalesce() (ansi)? They aren't exactly the same, unfortunately (nvl takes exactly 2 arguments, no more), so maybe

Re: [sqlalchemy] Oracle timestamp and postgres datetime compatibility

2009-12-02 Thread Ian Kelly
On Wed, Dec 2, 2009 at 3:25 PM, Michael Bayer mike...@zzzcomputing.com wrote: from the article:  Beware while the TO_CHAR function works with both datatypes, the TRUNC function will not work with a datatype of TIMESTAMP. This is a clear indication that the use of TIMESTAMP datatype should

[sqlalchemy] Re: #446: Two deletions cascading to the same object can result in an error

2007-01-30 Thread Ian Kelly
Finally, note that I'm _not_ asking for sqlalchemy to maintain the collections for me. All I'm asking is for the cascade code not to attempt to delete objects that have already been deleted and flushed, or at least to safely handle the exception it raises when it does. OK, what