Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added references to the various get_FOO_*() methods for FileField and

ImageField. Fixed #4025.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5785763833130953aaf261baacc90825dec08d98 1 parent b0b5023
Malcolm Tredinnick authored May 27, 2007

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. 12  docs/model-api.txt
12  docs/model-api.txt
@@ -269,6 +269,13 @@ For example, say your ``MEDIA_ROOT`` is set to ``'/home/media'``, and
269 269
 upload a file on Jan. 15, 2007, it will be saved in the directory
270 270
 ``/home/media/photos/2007/01/15``.
271 271
 
  272
+If you want to retrieve the upload file's on-disk filename, or a URL that
  273
+refers to that file, or the file's size, you can use the
  274
+``get_FOO_filename()``, ``get_FOO_url()`` and ``get_FOO_size()`` methods.
  275
+They are all documented here__.
  276
+
  277
+__ ../db-api/#get-foo-filename
  278
+
272 279
 Note that whenever you deal with uploaded files, you should pay close attention
273 280
 to where you're uploading them and what type of files they are, to avoid
274 281
 security holes. *Validate all uploaded files* so that you're sure the files are
@@ -338,9 +345,14 @@ image. Has two extra optional arguments, ``height_field`` and
338 345
 ``width_field``, which, if set, will be auto-populated with the height and
339 346
 width of the image each time a model instance is saved.
340 347
 
  348
+In addition to the special ``get_FOO_*`` methods that are available for
  349
+``FileField``, an ``ImageField`` also has ``get_FOO_height()`` and
  350
+``get_FOO_width()`` methods. These are documented elsewhere_.
  351
+
341 352
 Requires the `Python Imaging Library`_.
342 353
 
343 354
 .. _Python Imaging Library: http://www.pythonware.com/products/pil/
  355
+.. _elsewhere: ../db-api/#get-foo-height-and-get-foo-width
344 356
 
345 357
 ``IntegerField``
346 358
 ~~~~~~~~~~~~~~~~

0 notes on commit 5785763

Please sign in to comment.
Something went wrong with that request. Please try again.