Opened 3 months ago
Last modified 2 months ago
#36608 assigned Cleanup/optimization
dumpdata does not use custom serializers — at Version 1
| Reported by: | ksauder | Owned by: | |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 5.2 |
| Severity: | Normal | Keywords: | dumpdata custom serializers |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
As displayed in the diff, the code was simply broken and always raised an exception for custom serializer formats.
After further investigation, this problem could also be solved by adding 'internal_use_only = False' to the classes in the example here https://docs.djangoproject.com/en/5.2/topics/serialization/#custom-serialization-formats. This gets around the "if format in serializers.get_public_serializer_formats()" check, although the old code in the diff still doesn't make sense.
Change History (2)
by , 3 months ago
| Attachment: | dumpdata_fix.diff added |
|---|
comment:1 by , 3 months ago
| Description: | modified (diff) |
|---|