The problem is that web2py relies on the database to perform the data
conversion. Which database do you use?

Massimo

On Aug 17, 4:38 pm, Philip <philip.el...@gmail.com> wrote:
> I have an application that is up and running (which is relevant
> because I don't want to erase all the data already in it), in which I
> want to change a field type from float to decimal.  As soon as I
> change my model file and refresh the app, I get the following error:
>
> ValueError: invalid literal for int() with base 10: '
>
> As I understand it, that error should arise from trying to convert a
> string to an integer (and having a non-numeric character).  In this
> case, all the existing values in the database are floats, so when the
> field type is changed, the values should be converted from float to
> decimal - I don't see how that conversion would cause the above error.
>
> Is there anything about the migration of data that happens when a
> field type is changed that would cause an issue like this? Also, I am
> using SQLite as the DB; is that in some way contributing to the
> problem?
>
> Any suggestions?
>
> The reason for the switch was that the DB includes a lot of financial
> data, so the rounding errors that were resulting from using floats
> were unfortunately material.  If there's a better way to solve this
> problem, I'm all ears.
>
> Thanks,
> Philip

Reply via email to