-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#2903] Refactor import/export for ZaakType configs #1503
Conversation
46e6e64
to
c4d1d34
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1503 +/- ##
===========================================
- Coverage 94.31% 94.25% -0.06%
===========================================
Files 1068 1068
Lines 40386 40457 +71
===========================================
+ Hits 38089 38133 +44
- Misses 2297 2324 +27 ☔ View full report in Codecov by Sentry. |
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.
An architectural question before I proceed, but TLDR: I think we can perhaps make this simpler by just adding another factory method to CatalogusConfigExport
(and renaming it).
476ab5a
to
814eb49
Compare
b3c97d0
to
1b099a9
Compare
1b099a9
to
0a32b32
Compare
0a32b32
to
f4f89ce
Compare
src/open_inwoner/openzaak/admin.py
Outdated
CatalogusConfigExport, | ||
CatalogusConfigImport, | ||
) | ||
from open_inwoner.openzaak.import_export import CatalogusConfigImport, ZGWConfigExport |
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.
I guess we could propagate the rename to the import container as well:
from open_inwoner.openzaak.import_export import CatalogusConfigImport, ZGWConfigExport | |
from open_inwoner.openzaak.import_export import ZGWConfigImport, ZGWConfigExport |
@admin.action(description=_("Export to file")) | ||
def export_zaaktype_configs(modeladmin, request, queryset): | ||
export = ZGWConfigExport.from_zaaktype_configs(queryset) | ||
response = StreamingHttpResponse( | ||
export.as_jsonl_iter(), | ||
content_type="application/json", | ||
) | ||
response[ | ||
"Content-Disposition" | ||
] = 'attachment; filename="zgw-zaaktype-export.json"' | ||
return response | ||
|
||
def process_file_view(self, request): |
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.
The only thing that springs to mind is whether to do this as a mixin, given that there's non trivial logic here. But I would say we can add that to the technical debt list (because I think we might also want to add a Celery option given how long these imports take, but it shouldn't delay the current PR and patch release).
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.
Noted, I'll create a Taiga issue for this.
Taiga: https://taiga.maykinmedia.nl/project/open-inwoner/task/2903