I use Float for money at the moment. I am moving from Mysql to Postgres and have not had any issues but i'm not sure if Float actually works correctly. Floats are being used for both broken number values and for money values.
should I change to numeric for Postgres as I do not see that Column Type mentioned in this tread. Martijn On Dec 27, 2011, at 20:39 , dgardner wrote: > Quick hack, figured I would share since there seemed to be other > people asking about it. > > I couldn't get it to work with "autoload=True" for table reflection. > > --- > > from sqlalchemy import types > from decimal import Decimal > > class Money(types.UserDefinedType): > > def get_col_spec(self): > return 'money' > > def result_processor(self, dialect, coltype): > def process(value): > # Strip off the currency symbol > return Decimal(value[1:]) > return process > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
