Django

Code

Changeset 2960

Show
Ignore:
Timestamp:
05/22/06 00:04:40 (3 years ago)
Author:
adrian
Message:

Fixed funky formatting in docs/model-api.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/model-api.txt

    r2955 r2960  
    203203 
    204204    1. In your settings file, you'll need to define ``MEDIA_ROOT`` as the 
    205         full path to a directory where you'd like Django to store uploaded 
    206         files. (For performance, these files are not stored in the database.) 
    207         Define ``MEDIA_URL`` as the base public URL of that directory. Make 
    208         sure that this directory is writable by the Web server's user 
    209         account. 
     205       full path to a directory where you'd like Django to store uploaded 
     206       files. (For performance, these files are not stored in the database.) 
     207       Define ``MEDIA_URL`` as the base public URL of that directory. Make 
     208       sure that this directory is writable by the Web server's user 
     209       account. 
    210210 
    211211    2. Add the ``FileField`` or ``ImageField`` to your model, making sure 
    212         to define the ``upload_to`` option to tell Django to which 
    213         subdirectory of ``MEDIA_ROOT`` it should upload files. 
     212       to define the ``upload_to`` option to tell Django to which 
     213       subdirectory of ``MEDIA_ROOT`` it should upload files. 
    214214 
    215215    3. All that will be stored in your database is a path to the file 
    216         (relative to ``MEDIA_ROOT``). You'll must likely want to use the 
    217         convenience ``get_<fieldname>_url`` function provided by Django. For 
    218         example, if your ``ImageField`` is called ``mug_shot``, you can get 
    219         the absolute URL to your image in a template with ``{{ 
    220         object.get_mug_shot_url }}``. 
     216       (relative to ``MEDIA_ROOT``). You'll must likely want to use the 
     217       convenience ``get_<fieldname>_url`` function provided by Django. For 
     218       example, if your ``ImageField`` is called ``mug_shot``, you can get 
     219       the absolute URL to your image in a template with ``{{ 
     220       object.get_mug_shot_url }}``. 
    221221 
    222222.. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941