On Wednesday, July 27, 2016 at 10:49:52 AM UTC-7, [email protected] wrote: > > good morning > first of all thanks and congratulations for the wonderful work that is > web2py. > > I just started using it and I have this problem. > > writing on db.py I created a SQLite database, a table (articles) and I > imported data from an existing .dbf file with a script, > > it happens that the "data" field (the date of price change); if it is > empty generates an exception, "ValueError: invalid literal for int () with > base 10: '' if the field is full, everything ok. > > The "data" field is in format year, month, day. (looking with db browser) >
Can you give the 1st line of the file, and an example line that's ok and one that isn't? Also the define_table() from your model file ... I take it you're using 'datetime' for the relevant field type. I think the issue may be with the way in which "empty" is represented. > I tried to import it via .csv files and even .sql > > This happens only on the imported data, the records registered by the > form, everything ok. > I understand that the program understands that it is imported but should > accept it as it is, do not try to convert it (I think) > > Well, it's trying to turn strings into non-string values (that is, something like "January 10 2001" into the binary number that the database uses to represent that), so conversion is necessary. It would be the same for converting "134.56" into a DECIMAL field. I also imported with "db.articoli.import_from_csv_file (open ( 'z: > /articoli.csv'))" > > also as "migrate = false" > > but is all useless :( > > I can not find a solution, someone with a good heart can help me? > > for the magic Massimo .... why do not you talk more about the Italian ?? > :) > > tanks to all > /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

