[EMAIL PROTECTED] wrote: > according to sqlalchemy/types.py, the Decimal() is used straight away, > without any precision etc stuff. the numeric(precision/length) are only for > the db. i assume u have to use some precision-context around your db-related > stuff. > So, what is the correct why of doing this in the model? Using "Creating your Own Types", i.e. similar to the Unicode example in the doc, or is there a more correct/efficient way of doing this.
Werner > Werner F. Bruhin wrote: > >> I am converting an existing Firebird DB over to use sqlalchemy (0.4.0) >> and I can't figure out how to define the model for currency values. >> >> In the DB they are defined as numeric(18,2) default 0 and in the model I >> do e.g. >> >> sa.Column(u'cbb_currentvalue', >> sa.Numeric(precision=16,length=2,asdecimal=True)), >> >> However I don't get the trailing zero in my wxPython application, i.e. >> when I debug it I get: >> >> Decimal("26.2") or Decimal("0") >> >> I would have expected: >> >> Decimal("26.20") or Decimal("0.00") >> >> What am I missing? >> >> Appreciate any hints on this >> Werner >> >> >> >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---