Skip to content

Export-import object types with UUID retention#745

Open
CharString wants to merge 13 commits intomasterfrom
565-exportimport-object-types-with-uuid-retention
Open

Export-import object types with UUID retention#745
CharString wants to merge 13 commits intomasterfrom
565-exportimport-object-types-with-uuid-retention

Conversation

@CharString
Copy link
Contributor

@CharString CharString commented Mar 16, 2026

Fixes #565

Changes

Adds export to file action, and import from file to objecttype admin.

@CharString CharString linked an issue Mar 16, 2026 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 99.20635% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.37%. Comparing base (8d03167) to head (ec33c14).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/objects/core/import_export.py 98.86% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #745      +/-   ##
==========================================
+ Coverage   85.58%   86.37%   +0.79%     
==========================================
  Files         144      145       +1     
  Lines        3003     3142     +139     
  Branches      236      253      +17     
==========================================
+ Hits         2570     2714     +144     
+ Misses        381      376       -5     
  Partials       52       52              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

🐰 Bencher Report

Branch565-exportimport-object-types-with-uuid-retention
Testbedubuntu-24.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
performance_test/tests/test_objects_list.py::test_objects_api_list_filter_by_object_type📈 view plot
🚷 view threshold
129.48 ms
(+2.57%)Baseline: 126.25 ms
132.56 ms
(97.68%)
performance_test/tests/test_objects_list.py::test_objects_api_list_filter_one_result📈 view plot
🚷 view threshold
20.25 ms
(+0.85%)Baseline: 20.08 ms
21.09 ms
(96.04%)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_1📈 view plot
🚷 view threshold
336.00 ms
(+3.29%)Baseline: 325.29 ms
341.56 ms
(98.37%)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_5📈 view plot
🚷 view threshold
340.61 ms
(+1.39%)Baseline: 335.93 ms
352.73 ms
(96.56%)
performance_test/tests/test_objects_list.py::test_objects_api_list_small_page_size_page_20📈 view plot
🚷 view threshold
130.72 ms
(+2.13%)Baseline: 128.00 ms
134.40 ms
(97.27%)
🐰 View full continuous benchmarking report in Bencher

@CharString CharString force-pushed the 565-exportimport-object-types-with-uuid-retention branch 3 times, most recently from b40b7ce to 67eed69 Compare March 16, 2026 20:28
@CharString CharString changed the title 565 exportimport object types with UUID retention Export-import object types with UUID retention Mar 17, 2026
@CharString CharString force-pushed the 565-exportimport-object-types-with-uuid-retention branch 3 times, most recently from 8e11b96 to dc54480 Compare March 17, 2026 13:25
@CharString CharString force-pushed the 565-exportimport-object-types-with-uuid-retention branch from dc54480 to a3d29d5 Compare March 17, 2026 13:31
Queryset is never empty; django admin already checks this when
performing an action.
@CharString CharString force-pushed the 565-exportimport-object-types-with-uuid-retention branch from a3d29d5 to ae2f045 Compare March 17, 2026 14:21
@CharString CharString requested a review from stevenbal March 17, 2026 14:30
{{ form.non_field_errors }}
</div>
{% endif %}
<fieldset class="module aligned">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This "aligned" class makes field errors look visually "off" to my eyes (huge left margin). But it already looked like that...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm yeah it definitely looks off, could you remove the aligned class to make it look a bit better?

@CharString CharString requested a review from Floris272 March 18, 2026 09:34
Copy link
Collaborator

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

@CharString could you add some basic documentation under Manual to describe how to do exports and imports?

{{ form.non_field_errors }}
</div>
{% endif %}
<fieldset class="module aligned">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm yeah it definitely looks off, could you remove the aligned class to make it look a bit better?

)
keep_uuid = forms.BooleanField(
label=_("Keep the UUIDs the same"),
help_text=_("Import keeping the same UUID as in the export."),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
help_text=_("Import keeping the same UUID as in the export."),
help_text=_("Import keeping the same UUIDs as in the export."),


class Meta(_ObjectTypeSerializer.Meta):
fields = [
field for field in _ObjectTypeSerializer.Meta.fields if field not in ["url"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
field for field in _ObjectTypeSerializer.Meta.fields if field not in ["url"]
field for field in _ObjectTypeSerializer.Meta.fields if field != "url"

CharString and others added 4 commits March 20, 2026 15:11
Co-authored-by: Steven Bal <steven@maykinmedia.nl>
Still not super pretty, but .aligned has a lot of left margin, which looks
very off.
@CharString
Copy link
Contributor Author

@CharString could you add some basic documentation under Manual to describe how to do exports and imports?

@stevenbal I've put the documentation under Admin interface / object types where the other object type actions documented. But it can be moved of course.

@CharString CharString requested a review from stevenbal March 20, 2026 17:14
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

Successfully merging this pull request may close these issues.

Export/Import Object Types with UUID Retention

3 participants