#5485 closed (wontfix)
Changing repetitive uploaded files from underscores to numbers
Reported by: | emperorcezar | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | fs-rf-docs | |
Cc: | emperorcezar@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently The filefield adds an underscore if you upload to a file that already exists. This leads to files like file_.txt
This is annoying. The patch sets the system to create files file.txt, file_2.txt ..... file_99.txt etc.
Attachments (1)
Change History (15)
by , 17 years ago
Attachment: | base.py.diff added |
---|
comment:1 by , 17 years ago
Component: | Uncategorized → Database wrapper |
---|---|
Has patch: | set |
Needs tests: | set |
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Every solution to this problem will annoy someone; if we switch it to numbers, someone who liked the underscores will complain. Since this is essentially arbitrary, and since Django's already picked a solution, I'm going to wontfix this.
comment:3 by , 17 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
The issue is two-fold. First, some systems have a character limit on filenames (255 on BSD if I remember). Second, it's difficult to manually and visually distinguish between underscored files. Put 30 avatar_.jpg files like avatar.jpg avatar_.jpg. Then when one has to delete the correct one by hand for some reason, a mistake becomes extremely easy vs deleting avatar_15.jpg Also, at what point will the database max out on the file length? It is my opinion that the repeated underscore may be simple and fast, but they are by far not effective when an application has to scale.
comment:4 by , 17 years ago
Triage Stage: | Design decision needed → Accepted |
---|
comment:5 by , 17 years ago
Keywords: | fs-rf added |
---|
comment:6 by , 17 years ago
Keywords: | fs-rf-docs added; fs-rf removed |
---|
comment:7 by , 16 years ago
milestone: | → 1.0 beta |
---|
comment:8 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
I will write some tests for this patch
comment:9 by , 16 years ago
With Trunk SVN: Last Changed Rev: 7950
I cannot apply this patch to attempt writing tests:
patch: Only garbage was found in the patch input.
Very strange.
comment:10 by , 16 years ago
With #5361, this behavior will be made quite easy, and its documentation will explain how to do it. In fact, there's already a test on that patch making sure that Trac-style file numbering (filename.3.txt, etc) works just fine. I've left this ticket open so we can keep of everything that #5361 is looking to address, but any fixes to this will be applied in that ticket instead.
The fs-rf-docs
keyword here means that the docs on #5361 will explain how to do it, but it won't be enabled by default. There's certainly a case for changing it, and it would be backwards-compatible, since existing filenames are already stored in the database, but at the moment I'm not planning to change the default behavior.
comment:12 by , 16 years ago
Cc: | added |
---|
comment:13 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
File storage is in as of [8244], so I'm marking this as wontfix -- as Marty says, it's very easy to write a custom file storage backend that works exactly how you like it.
What is the problem with underscore? Its simple, fast and effective.