Author: adrian
Date: 2006-08-08 10:03:01 -0500 (Tue, 08 Aug 2006)
New Revision: 3538

Modified:
   django/trunk/docs/model-api.txt
Log:
Added example of strftime formatting to docs/model-api.txt FileField docs. 
Thanks for the suggestion, Bradley Whittington

Modified: django/trunk/docs/model-api.txt
===================================================================
--- django/trunk/docs/model-api.txt     2006-08-08 04:56:39 UTC (rev 3537)
+++ django/trunk/docs/model-api.txt     2006-08-08 15:03:01 UTC (rev 3538)
@@ -223,6 +223,13 @@
        the absolute URL to your image in a template with ``{{
        object.get_mug_shot_url }}``.
 
+For example, say your ``MEDIA_ROOT`` is set to ``'/home/media'``, and
+``upload_to`` is set to ``'photos/%Y/%m/%d'``. The ``'%Y/%m/%d'`` part of
+``upload_to`` is strftime formatting; ``'%Y'`` is the four-digit year,
+``'%m'`` is the two-digit month and ``'%d'`` is the two-digit day. If you
+upload a file on Jan. 15, 2007, it will be saved in the directory
+``/home/media/photos/2007/01/15``.
+
 .. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941
 
 ``FilePathField``


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---

Reply via email to