Opened 19 years ago
Closed 17 years ago
#231 closed defect (fixed)
[patch] Make appropriate model fields honor max_length param
Reported by: | nesh <nesh [at] studioquattro [dot] co [dot] yu> | Owned by: | donspaulding |
---|---|---|---|
Component: | Metasystem | Version: | |
Severity: | normal | Keywords: | FileFields max_length sprintsept14 |
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
Add maxlength option to FileField or another way to set maximum length. I have problem with long paths get truncated when file is posted.
Another solution is to store file names relative to upload_to parameter.
Attachments (3)
Change History (19)
comment:1 by , 19 years ago
Summary: | add maxlenght to FileField → Add maxlength option to FileFields |
---|
comment:2 by , 19 years ago
comment:3 by , 18 years ago
Keywords: | FileFields added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 18 years ago
Has patch: | set |
---|---|
Summary: | Add maxlength option to FileFields → [patch] Add maxlength option to FileFields |
comment:5 by , 18 years ago
Patch needs improvement: | set |
---|
The manipulators code needs to be changed as well to support this. This patch is incomplete.
comment:6 by , 17 years ago
Owner: | changed from | to
---|---|
Summary: | [patch] Add maxlength option to FileFields → [patch] Make appropriate model fields honor max_length param |
Triage Stage: | Accepted → Design decision needed |
I think model fields in db/models/fields/init.py need to deal with max_length in a consistent manner. They can keep their old hard-coded values if a kwarg isn't provided, but otherwise, they should use the provided one. Latest patch should reflect those changes.
comment:7 by , 17 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | unset |
Triage Stage: | Design decision needed → Accepted |
comment:8 by , 17 years ago
Keywords: | sprintsept14 added |
---|
comment:10 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:11 by , 17 years ago
Status: | new → assigned |
---|
comment:12 by , 17 years ago
Needs tests: | unset |
---|
comment:13 by , 17 years ago
Patch needs improvement: | set |
---|
The patch looks nice. I've checked that all backends are covered. One small nitpick: the doc says max_length only exist in the dev version, maybe it would be more generic to say that it is only supported in version > .96. I've had to touch tests/regressiontests/max_lengths/init.py to make the tests works though, it should be added in the patch (if possible, i know svn is tricky with empty files).
comment:14 by , 17 years ago
Keywords: | max_length added |
---|---|
Patch needs improvement: | unset |
Phir, good catch on the init file, I added a blank line so Trac's diff display would pick it up, though I'm not sure that's the standard way to add init files.
comment:15 by , 17 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I think this just needs a final once over by a couple of core devs before committing.
by , 17 years ago
Attachment: | max_length_cleanups_with_docs.diff added |
---|
Cleaned up handling of max_length in model fields, form fields, and added documentation. Tests included.
comment:16 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
did this get closed? it really should exist, i had to manually update the table to accept the longer path names. and yes, for portability there shouldn't be full paths in my opinion.