#25050 closed Bug (fixed)
When the default manager returns a queryset with a deferred field, the dumpdata command fails to produce importable data.
Reported by: | cecedille1 | Owned by: | nobody |
---|---|---|---|
Component: | Core (Serialization) | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
When the default manager returns a queryset that has deferred fields, with Queryset.only or Queryset.deferred, the dumpdata command will print the model name as *the model*_derred_*thefields*. This model name make the import fail.
I made a github project to expose the bug: https://github.com/cecedille1/DjangoBug
I've a project with a table containing images as blobs. I deferred the image to avoid retrieving too many datas from the database.
Attachments (1)
Change History (7)
comment:1 by , 9 years ago
Component: | Uncategorized → Core (Serialization) |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 9 years ago
Easy pickings: | set |
---|
comment:3 by , 9 years ago
When running the serialization I resolve the original model from the meta.
comment:4 by , 9 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Note:
See TracTickets
for help on using tickets.
This should be only a matter of making the python serializer `get_dump_object` method deal with deferred models.