[patch] repr(uploadfile) should not contain the file content
|Reported by:||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If uploadfilecontent? is very long, repr(uploadfile) produce non-readable stuff.
It sometimes make a browser hang.
A significant performance problem occur on following scenario.
- You have a model that has many nullable/blankable fields with a FileField.
- You upload big file, without filling nullable fields.
- In view, manipulator.save is called.
- for each field, validation is called.
- for nullable field, while getting field from new_data, repr(new_data) is called, which trigger repr(upload_file)
- repr(upload_file) is very long. It is called for each nullable field. this take long time. (taked 4s~12s for my app)
Sorry for my poor explanation.
Change History (5)
comment:2 Changed 10 years ago by
|Summary:||[PATCH] repr(uploadfile) should not contain the file content. → [patch] repr(uploadfile) should not contain the file content|