mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
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:
parent
b67ab75e82
commit
945e033a69
7 changed files with 25 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue