-
Notifications
You must be signed in to change notification settings - Fork 13
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
Integrate django-import-export to allow bulk import and export #384
Conversation
24f9f19
to
65f18c6
Compare
65f18c6
to
d7aa2a9
Compare
I thought that Django already had some kind of built in import/export tool. Do we really need to add another dependency? https://docs.djangoproject.com/en/5.0/ref/django-admin/#dumpdata https://docs.djangoproject.com/en/5.0/ref/django-admin/#loaddata |
Those commands only allow you to export/replace large chunks of data like entire tables, and require CLI access and knowledge. This is a totally different use case? Read the slack thread linked in the issue please |
Sorry, I thought that loaddata might be sufficient for this usecase, but if it's not, it's not. Let me take a look at the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. Can you add some docs on how to use it to the README?
if "install_number" not in dataset.headers: | ||
dataset.headers.append("install_number") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, why this is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this is due to our custom primary key setup. Something about the lack of auto increment
I think the wiki is a better place for docs, since this is end-user focused not dev focused. But yeah I can write something up |
Integrates a bulk import library to allow bulk import and export of objects. Our tables with custom primary key values need a slight customization, but nothing too bad
https://github.com/django-import-export/django-import-export
Tested export/import to/from CSV
Closes #201