> By default, FileField instances are created as varchar(100) columns in
your database.
Personally I find the intent of this sentence confusing. The phrase "by
default", leads me to believe this is something I can modify. Yet, I find
no documentation on how to modify this. I was looking for a way to modify
the `FileField` to be represented as a FK to a custom `FileMetadata`
model. This gave me hope that it was possible. Upon looking for more
documentation and looking at the source, I did not find any clear guidance
on how to approach this.
It seems this should be more of a direct statement by dropping "by
default":
> FileField instances are created as varchar(100) columns in your
database.
--
Ticket URL: <https://code.djangoproject.com/ticket/23676>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* needs_docs: => 0
Comment:
I think what's trying to be implied is that you can customize the length
using the `max_length` option.
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:1>
Comment (by jdufresne):
> I think what's trying to be implied is that you can customize the length
using the max_length option.
I agree. I think with the "by default" removed the second sentence does a
fine job of explaining that:
> FileField instances are created as varchar(100) columns in your
database. As with other fields, you can change the maximum length using
the max_length argument.
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:2>
Comment (by jdufresne):
What about the following which emphasizes that the "by default" is for the
length only
> FileField instances are created as varchar columns with a default length
100 in your database. As with other fields, you can change the maximum
length using the max_length argument.
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:3>
Comment (by timgraham):
Makes sense to me. I'd just change the order a bit: "FileField instances
are created in your database as varchar columns with a default max length
of 100 characters."
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:4>
Comment (by jdufresne):
Thanks. I've incorporated your suggestions in a pull request
<https://github.com/django/django/pull/3384>.
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"c1b9f99a812d01124ba4ddefcafaa90dcb5b05ae"]:
{{{
#!CommitTicketReference repository=""
revision="c1b9f99a812d01124ba4ddefcafaa90dcb5b05ae"
Fixed #23676 -- Rearranged sentence; "by default" applies only to max
length
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7d90fed1a073318defbb7cf80015530a38a09bbc"]:
{{{
#!CommitTicketReference repository=""
revision="7d90fed1a073318defbb7cf80015530a38a09bbc"
[1.6.x] Fixed #23676 -- Rearranged sentence; "by default" applies only to
max length
Backport of c1b9f99a81 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"37ab955d69ea541b4c66e225cc24dc0a2ee057be"]:
{{{
#!CommitTicketReference repository=""
revision="37ab955d69ea541b4c66e225cc24dc0a2ee057be"
[1.7.x] Fixed #23676 -- Rearranged sentence; "by default" applies only to
max length
Backport of c1b9f99a81 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23676#comment:8>