Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-07 Thread jo
this is the 0.3 syntax, and now it works. class MyType(TypeDecorator): impl = Numeric def convert_bind_param(self, value, engine): return decimal.Decimal(str(value)) def convert_result_value(self, value, engine): return decimal.Decimal(str(value)) Thank you very much, Michael. :-) j jo wrote:

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-07 Thread jo
Michael Bayer wrote: jose soares wrote: Michael Bayer wrote: jose soares wrote: Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a differe

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread Michael Bayer
jose soares wrote: > Michael Bayer wrote: >> jose soares wrote: >> >>> Hi all, >>> >>> I'm using Oracle and PostgreSQL with SQLAlchemy and I have some >>> troubles >>> to make the code compatible with both of them. >>> Numeric sa type returns a different type with oracle and pg. >>> >>> For exampl

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread jose soares
Michael Bayer wrote: jose soares wrote: Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a different type with oracle and pg. For example, in the following table I'm using the Column 'imp

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread Michael Bayer
jose soares wrote: > Hi all, > > I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles > to make the code compatible with both of them. > Numeric sa type returns a different type with oracle and pg. > > For example, in the following table I'm using the Column 'importo' with > ty

[sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread jose soares
Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a different type with oracle and pg. For example, in the following table I'm using the Column 'importo' with type Numeric as: tbl['presta