You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an xlsx file, i have a column of string values, such as "66", "783 Foo". On import into a CharField, it seems that any value that can be interpreted as a decimal is converted to one, like "66.0", while other values like "783 Foo" remain as-is. The desired result is that the data is not reformatted that way.
The text was updated successfully, but these errors were encountered:
This and your other issues are seem valid. There is a general problem of the user expects it to be imported one way but it gets imported another. With some exceptions the import does setattr(new_object, header_row_field_name, cell). And cell is whatever the library that opened the import file gives out. For more fun different libraries give different results. If you have any ideas to solve this let me know.
Wouldn't an importer be able to determine the cell type for most import formats? i suspect we could read the cell format and then compare against a mapping of python types.
One format which wouldn't have that kind of support is a csv. Since a csv can store decimals and integers without quotes, it should work fine unless cell is formatted as a decimal with commas as the thousands separator, as the whole number has to be enclosed in quotes. A tab-separated file wouldn't have this issue. Examples of csv and tsv for different column types: https://gist.github.com/smcoll/86359a58b6e166b36e4d
In an xlsx file, i have a column of string values, such as "66", "783 Foo". On import into a CharField, it seems that any value that can be interpreted as a decimal is converted to one, like "66.0", while other values like "783 Foo" remain as-is. The desired result is that the data is not reformatted that way.
The text was updated successfully, but these errors were encountered: