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 #3381

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stefanvi
Copy link
Contributor

Closes #1081
Duplicate of #2665 because creating a new branch was easier than fixing that one

This list below shows which classes still need to be implemented.

  • MemberGroupMembership
  • Exam
  • Summary
  • Payment
  • BankAccount
  • UserList
  • UserEmailList
  • Event
  • Batch

The last two are difficult because they have querysets that contain the actual data that needs to be exported. Registrations in case of Event and Payments in case of Batch. Also, the current event exporter has a lot of additional logic, which makes it difficult to define a resource class for it.

How to test: go to the admin page and navigate to one of the items on the list. Then in the dropdown there will be an option to export, where you can also choose the export file type. One exception is the export for users. This one allows two types of exports (UserList and UserEmailList). This is a fairly new feature of the library and does not (yet) support the inline dropdown that the other one uses. Instead, there is an export button that brings you to a separate page.

User export
image

Other export
image

@github-actions github-actions bot added app:activemembers Issues regarding the activemembers-app app:education Issues regarding the education-app app:events Issues regarding the events-app app:members Issues regarding the members-app app:payments Issues regarding the payments-app labels Sep 27, 2023
@stefanvi stefanvi force-pushed the implement-import-export-library branch from 2c64946 to 7c23faa Compare October 3, 2023 18:54
now = timezone.now()
self.queryset = self.queryset.select_related("member", "group")

# Show only memberships that are active now.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you delete this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I think what happened is that when I copied the code from the older branch (which was a mess), I accidentally copied the old implementation for this class as well. I've fixed it now locally.

Unfortunately, I've also found another issue, because it seems like it's not possible to export only selected users from the separate Member export page. You can only export every member. I'll see if I can find a solution before pushing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:activemembers Issues regarding the activemembers-app app:education Issues regarding the education-app app:events Issues regarding the events-app app:members Issues regarding the members-app app:payments Issues regarding the payments-app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement import-export library
2 participants