Ticket #8243: model-api-docs_r8310.diff
File model-api-docs_r8310.diff, 1008 bytes (added by , 16 years ago) |
---|
-
docs/model-api.txt
296 296 297 297 3. All that will be stored in your database is a path to the file 298 298 (relative to ``MEDIA_ROOT``). You'll most likely want to use the 299 convenience `` get_<fieldname>_url`` function provided by Django. For300 example, if your ``ImageField`` is called ``mug_shot``, you can get301 the absolute URL to your image in a template with ``{{302 object.get_mug_shot_url }}``.299 convenience ``url`` attribute provided by ``FileField`` and 300 ``ImageField``. For example, if your ``ImageField`` is called 301 ``mug_shot``, you can get the absolute URL to your image in a template 302 with ``{{ object.mug_shot.url }}``. 303 303 304 304 For example, say your ``MEDIA_ROOT`` is set to ``'/home/media'``, and 305 305 ``upload_to`` is set to ``'photos/%Y/%m/%d'``. The ``'%Y/%m/%d'`` part of