Re: Defining your own fields for newforms

2007-07-15 Thread Malcolm Tredinnick
On Sun, 2007-07-15 at 20:07 +0200, Christian Joergensen wrote: > Hi > > I am working on defining my own CurrencyField for newforms. The idea is > to store the value (amount) in the DB by the smallest unit as an > IntegerField. That is: > > 1,450.75 => 145075 > > The clean method will happily

Re: Defining your own fields for newforms

2007-07-15 Thread Christian Joergensen
John Shaffer wrote: > I see you're using a recent trunk checkout. Why not use models.DecimalField, > newforms.DecimalField, and the Python decimal module? They will accurately > handle your data with much less effort. As long as i can be sure that it will never fall back to some sort of float repr

Re: Defining your own fields for newforms

2007-07-15 Thread John Shaffer
I see you're using a recent trunk checkout. Why not use models.DecimalField, newforms.DecimalField, and the Python decimal module? They will accurately handle your data with much less effort. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Defining your own fields for newforms

2007-07-15 Thread Christian Joergensen
Hi I am working on defining my own CurrencyField for newforms. The idea is to store the value (amount) in the DB by the smallest unit as an IntegerField. That is: 1,450.75 => 145075 The clean method will happily clean the incoming strings into the right amount formatted as an integer: In [2