#8217 closed (fixed)
Alphabetical sorted FilePathField
| Reported by: | bernd | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When using the FilePathField-form-field I get an unordered list of files (I think the files are ordered by creation date).
If there are a lot of files it's very hard to get a good overview with this order.
My idea is to sort the files in alphabetical order which makes a long list much more easier to read.
I added a patch and run the test on "forms" without any errors.
Attachments (2)
Change History (11)
by , 17 years ago
| Attachment: | FilePathField-sorted.diff added |
|---|
comment:1 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
by , 17 years ago
| Attachment: | FilePathField-sorted_py2.3.diff added |
|---|
comment:2 by , 17 years ago
I added a patch that does the sorting properly on Python 2.3. The "forms" tests passed without errors.
comment:3 by , 15 years ago
Now that Python 2.3 support has been dropped, the first patch seems fine (it even still applies on current trunk). Ready to commit?
comment:5 by , 15 years ago
| milestone: | → 1.3 |
|---|
comment:6 by , 15 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
I could reproduce this on a Debian Lenny server.
comment:7 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
sorted()is new in 2.4, so the patch needs to uselist.sort. Otherwise, good.