diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-10-10 14:00:20 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-10-10 14:00:20 +0000 |
| commit | 474cfe56d4a9563f5acf5846f718e480752d4ff3 (patch) | |
| tree | 4bf9b75aac87f763993881be9e70cfbe68059a3b /docs/model-api.txt | |
| parent | b4e2d12b1f3f7da728c78de4b790040a0080a2d7 (diff) | |
Fixed #601 -- Updated docs/model-api.txt unique_together section to say it's enforced at the database level.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
| -rw-r--r-- | docs/model-api.txt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt index 4af193ca48..fd70409213 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -248,18 +248,18 @@ Here are all available field types: uploaded files don't fill up the given directory). The admin represents this as an ``<input type="file">`` (a file-upload widget). - - Using a `FieldField` or an ``ImageField`` (see below) in a model takes a few + + Using a `FieldField` or an ``ImageField`` (see below) in a model takes a few steps: - + 1. In your settings file, you'll need to define ``MEDIA_ROOT``as the full path to a directory where you'd like Django to store uploaded files. (For performance, these files are not stored in the database.) Define ``MEDIA_URL`` as the base public URL of that directory. Make sure that this directory is writable by the Web server's user account. - - 2. Add the ``FileField`` or ``ImageField`` to your model, making sure + + 2. Add the ``FileField`` or ``ImageField`` to your model, making sure to define the ``upload_to`` option to tell Django to which subdirectory of ``MEDIA_ROOT`` it should upload files. @@ -269,7 +269,7 @@ Here are all available field types: example, if your ``ImageField`` is called ``mug_shot``, you can get the absolute URL to your image in a template with ``{{ object.get_mug_shot_url }}``. - + .. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941 ``FloatField`` @@ -302,7 +302,7 @@ Here are all available field types: width of the image each time a model instance is saved. Requires the `Python Imaging Library`_. - + .. _Python Imaging Library: http://www.pythonware.com/products/pil/ ``IntegerField`` @@ -721,7 +721,9 @@ Here's a list of all possible ``META`` options. No options are required. Adding unique_together = (("driver", "restaurant"),) This is a list of lists of fields that must be unique when considered - together. It's used in the Django admin. + together. It's used in the Django admin and is enforced at the database + level (i.e., the appropriate ``UNIQUE`` statements are included in the + ``CREATE TABLE`` statement). ``verbose_name`` A human-readable name for the object, singular:: |
