Skip to content
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

IndexError: Index out of range #49

Open
juandiegovd opened this issue May 10, 2020 · 2 comments
Open

IndexError: Index out of range #49

juandiegovd opened this issue May 10, 2020 · 2 comments

Comments

@juandiegovd
Copy link

Hi, when i use the save_book_to_database almost keeping with your example i kept getting the Index out of range error, but with other functions such as get_dict it works fine, what could be the problem?

@chfw
Copy link
Member

chfw commented May 11, 2020

Any trace back for further diagnosis?

@Guitaryuga
Copy link

This can be somewhat of necroposting, but i had a similiar problem and found some nuanses, that can help someone troubleshooting their apps:
1)Remember about case sensitivity, names of your sheets must be EXACTLY the same as your models names

2)If in your model you use syntax like:

class Documents(db.Model):
    __tablename__ = 'My documents'

Then your sheet name must be 'My documents', not just 'Documents'

3)The number of sheets in your excel file should be the SAME as number of tables you use in 'tables' parameter of save, plus point 1&2 of my comment.
For example, i had an IndexError because after i added sheets with my information and renamed existing ones with names of my tables, i still had a sheet like 'Sheet 4', that was blank and i forgot about it. After i deleted it, everything started to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants