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

Implement import-export library #1081

Open
se-bastiaan opened this issue Apr 15, 2020 · 7 comments · May be fixed by #3381
Open

Implement import-export library #1081

se-bastiaan opened this issue Apr 15, 2020 · 7 comments · May be fixed by #3381
Assignees
Labels
chore Something that is not a bug or a feature, does not change production behaviour easy and fun Easy to solve priority: low Should be dealt with when nothing else remains.

Comments

@se-bastiaan
Copy link
Contributor

Describe the change

We could may be use https://django-import-export.readthedocs.io/en/latest/# for the importing (do we do that?) and exporting of information.

Motivation

We have a lot of duplicated csv exporting. And we have limited this to only what is necessary. With such a plugin exporting would become a breeze for all the data we have.

Current implementation

We have duplicated CSV exporting options everywhere.

Suggested implementation

Nice mixins.

Additional context

This issue should result in a new issue (possibly just change this one) that explains the benefits over just refactoring our current code. And if there are no benefits this issue is done and should be closed.

@se-bastiaan se-bastiaan added priority: low Should be dealt with when nothing else remains. chore Something that is not a bug or a feature, does not change production behaviour labels Apr 15, 2020
@JobDoesburg
Copy link
Contributor

The only places where importing might be nice to have is:

  • mentorships
  • email groups (think of study-trip participants)
  • possibly in the far future: payments
  • courses
  • pizza products

Exports might be nice at many places of course

@JobDoesburg
Copy link
Contributor

I've used it in a couple of my own projects and it works really well

@JobDoesburg JobDoesburg self-assigned this Aug 2, 2020
@JobDoesburg JobDoesburg removed their assignment Sep 23, 2020
@JobDoesburg
Copy link
Contributor

JobDoesburg commented Sep 23, 2020

It appears to be more difficult than I thought upfront, because import-export-admins are only able to just import/export model fields. It is more complex if, for example, you want to include 'the email of the user of this event registration' or 'the number of registrations / cancellations for this event' in the export. It is not impossible, but it is quite complex as it requires you to redefine your models as resources.ModelResources. So it's not only an admin-side change

@se-bastiaan
Copy link
Contributor Author

Let's close this, I don't really see us doing this if it is more complex than what we have already.

@JobDoesburg
Copy link
Contributor

I don't really agree. I do think it is a nice thing to do, as defining ModelResources is not very hard to do and it does make your code really nicely readable.

@se-bastiaan se-bastiaan reopened this Oct 19, 2020
@se-bastiaan
Copy link
Contributor Author

This library is awesome, would really make it easier to do some things that we have built manually

@JobDoesburg
Copy link
Contributor

I recently tried this out for a hobby project of mine and it works like a charm :) (at least, the exporting part. The importing part is a bit more tricky but luckily we don't use that)

@JobDoesburg JobDoesburg added the easy and fun Easy to solve label Aug 12, 2021
@pingiun pingiun changed the title Investigate import-export library Implement import-export library May 11, 2022
@stefanvi stefanvi self-assigned this May 11, 2022
@stefanvi stefanvi linked a pull request Nov 16, 2022 that will close this issue
9 tasks
@stefanvi stefanvi linked a pull request Sep 27, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Something that is not a bug or a feature, does not change production behaviour easy and fun Easy to solve priority: low Should be dealt with when nothing else remains.
Projects
None yet
3 participants