Fixed #8918 -- Made FileField.upload_to optional.

Thanks leahculver for the suggestion and dc and vajrasky for work
on the patch.
This commit is contained in:
Tim Graham 2013-10-11 08:07:25 -04:00
parent b67ab75e82
commit 945e033a69
7 changed files with 25 additions and 17 deletions

View file

@ -45,10 +45,9 @@ Using a :class:`~django.db.models.FileField` or an
account.
#. Add the :class:`~django.db.models.FileField` or
:class:`~django.db.models.ImageField` to your model, making sure to
define the :attr:`~django.db.models.FileField.upload_to` option to tell
Django to which subdirectory of :setting:`MEDIA_ROOT` it should upload
files.
:class:`~django.db.models.ImageField` to your model, defining the
:attr:`~django.db.models.FileField.upload_to` option to specify a
subdirectory of :setting:`MEDIA_ROOT` to use for uploaded files.
#. All that will be stored in your database is a path to the file
(relative to :setting:`MEDIA_ROOT`). You'll most likely want to use the