[patch] repr(uploadfile) should not contain the file content
|Reported by:||Jeong-Min Lee <falsetru@…>||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)
Changed 10 years ago by Jeong-Min Lee <falsetru@…>
comment:2 Changed 10 years ago by adrian
- Summary changed from [PATCH] repr(uploadfile) should not contain the file content. to [patch] repr(uploadfile) should not contain the file content
comment:3 Changed 9 years ago by SmileyChris
- Triage Stage changed from Unreviewed to Design decision needed