Django

Code

Ticket #3588 (closed: duplicate)

Opened 1 year ago

Last modified 10 months ago

increase length of FileField, FilePathField, ImageField from varchar(100)

Reported by: midfield <midfield@gmail.com> Assigned to: nobody
Milestone: Component: Database wrapper
Version: SVN Keywords: FileField FilePathField ImageField
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 1
Needs tests: 0 Patch needs improvement: 1

Description

If you run into long file names and / or paths, this is an onerous restriction. Please make FileField?, FilePathField?, ImageField? use varchar(maxlength).

Attachments

3588-filefield_maxlength.patch (4.5 kB) - added by Robert Myers <myer0052@gmail.com> on 02/27/07 15:18:30.
3588-filefield_maxlength_2.patch (4.5 kB) - added by Robert Myers <myer0052@gmail.com> on 02/27/07 15:34:22.
3588-filefield_unlimited.patch (4.4 kB) - added by Chaiwat S. <cwt@bashell.com> on 03/27/07 05:34:22.

Change History

02/26/07 22:19:09 changed by Robert Myers <myer0052@gmail.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

This restriction does seem rather limiting.

02/27/07 15:18:30 changed by Robert Myers <myer0052@gmail.com>

  • attachment 3588-filefield_maxlength.patch added.

02/27/07 15:34:22 changed by Robert Myers <myer0052@gmail.com>

  • attachment 3588-filefield_maxlength_2.patch added.

02/27/07 15:36:55 changed by Robert Myers <myer0052@gmail.com>

  • has_patch set to 1.
  • stage changed from Accepted to Ready for checkin.

I have changed the creation files to make the FileField?, FilePathField?, and ImageField? to be varchar(255). Which is the max length of filenames for Fat/Ext2/Ext3 and also the limit for varchar in Mysql < 5.0.3 Also I noticed the oracle Slugfield was hardcoded to 50 I changed it to varchar2(%(maxlength)s) which is the same as the other backends.

02/27/07 15:52:17 changed by midfield@gmail.com

while 255 is the maximum length for a filename, FileField? et al has to potetially store entire paths to files, which can easily get longer than 255. so this is a minor vote again for varchar(maxlength) for FileFields? et al.

02/28/07 05:41:26 changed by Simon G. <dev@simon.net.nz>

  • summary changed from FileField, FilePathField, ImageField shouldn't be varchar(100) to increase length of FileField, FilePathField, ImageField from varchar(100).

03/27/07 05:34:22 changed by Chaiwat S. <cwt@bashell.com>

  • attachment 3588-filefield_unlimited.patch added.

03/27/07 05:35:34 changed by Chaiwat S. <cwt@bashell.com>

I think it should be better if we change to 'text' to support path + filename. So I create a patch base on 3588-filefield_maxlength_2.patch, but change to 'text' or something like 'TextField?'.

04/25/07 05:39:59 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Ready for checkin to Accepted.
  • needs_docs set to 1.

Part of fixing this bug includes writing up instructions for how to port existing models to the changed versions. These are the instructions that will go on the [BackwardsIncompatibleChanges] wiki page.

So, in addition to updating the patch to include the postgresql_psycopg2 backend, can people please start working out how to move models across to this new version for each of our supported databases (MySQL, PostgreSQL and SQLite). For bonus points, work out the Oracle version as well, but we can probably ask the Oracle Boulder Sprinters group for help with that.

09/16/07 13:19:34 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to duplicate.

Duplicate of #5361.


Add/Change #3588 (increase length of FileField, FilePathField, ImageField from varchar(100))




Change Properties
Action