-
-
Notifications
You must be signed in to change notification settings - Fork 788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xls data cell format #96
Comments
Can you provide stack trace, tablib version, and minimal failing xls file. |
I will do so later today. I should have done this in the first place, sorry for this. |
Here is the requested info : django-import-export==0.2.2 Error message Line number: 1 - invalid literal for int() with base 10: '' Traceback (most recent call last): |
failing xls file attached On Fri, Jun 13, 2014 at 8:08 AM, Bojan Mihelac notifications@github.com
|
@sprenge can you upload xls from web interface, it does not seem to work over email. |
@bmihelac I'm having an issue with the format as well. Here is my model with two charfields:
And, the admin:
On a test import, if a column, say office_code, only contains numbers, the importer will add a '.0' on the end of each. In the excel file, I've tried using the format tool to format as text, but this didn't help. How do I go about saving without adding the periods and zeros? Thanks a lot for the helpful plugin! |
@bmihelac any updates on this? I'm getting
|
It doesn't happen with |
I fixed it with overriding class CharWidget(widgets.CharWidget):
def clean(self, value, row=None, *args, **kwargs):
if isinstance(value, float):
value = int(value)
return "{}".format(value)
return value |
i have the same issue:
|
@walterliang Did you try the fix that was submitted by @bcanyelles ? |
I have the impression that for xls import the data cell format must be a string. I get import failures when the cell input type is for instance numeric.
The text was updated successfully, but these errors were encountered: