alfonsodg / demo-web2py

Apache License 2.0
0 stars 0 forks source link

CSV Import broken #30

Closed alfonsodg closed 10 years ago

alfonsodg commented 10 years ago

From francisb...@gmail.com on February 10, 2009 16:54:02

What steps will reproduce the problem? 1. Export a table

  1. Import it again What is the expected output? What do you see instead? 1. Expect that Validation occurs - it doesn't. (e.g. in the example app db.users.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, 'users.email')] Yet duplicate email addresses result from an import. This is definitely not what we want for UUID fields...I would like options to either update the row with the same UUID field or else simply ignore it.
  2. in the CSV file => won't import: 'unable to parse csv file'
  3. Date in the CSV file => won't import: ValueError: invalid literal for int() with base 10: '11/01/2009'

Python produces output like this using import datetime; print str(datetime.datetime.now()): 2009-01-12 20:12:35.390000 The CSV has data like this: 12/01/2009 19:57:55 What version of the product are you using? On what operating system? Trunk on Windows XP (en-gb locale)

Original issue: http://code.google.com/p/web2py/issues/detail?id=31

alfonsodg commented 10 years ago

From francisb...@gmail.com on February 10, 2009 15:59:25

  1. As-explained by Massimo, Form validators cannot be applied during CSV Import as some are locale-specific. I have written the UUID validator in my own App instead: http://bazaar.launchpad.net/~flavour/sahana/sahanapy-trunk/revision/95 2 & 3 are being worked-on.
alfonsodg commented 10 years ago

From massimod...@gmail.com on February 11, 2009 11:34:31

The issue is now fixed in trunk.

Validation on import cannot be done since validation applies to user input and would require a different type/set of validators for validating csv files.

I cannot reproduce the datetime issue but we are working on it.

alfonsodg commented 10 years ago

From francisb...@gmail.com on February 11, 2009 15:10:25

datetime is also now fixed. Issue can be closed. Many thanks :)

F

alfonsodg commented 10 years ago

From massimod...@gmail.com on February 11, 2009 17:36:04

Status: Fixed