Fixed #10497 -- Added a few time-related methods to the storage API. Thanks for the report and patch to Stephan Jaekel.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2010-10-08 15:11:59 +00:00
parent 4d4d68a2cd
commit 58b704d8da
3 changed files with 114 additions and 5 deletions

View file

@ -13,6 +13,33 @@ The local filesystem path where the file can be opened using Python's standard
``open()``. For storage systems that aren't accessible from the local
filesystem, this will raise ``NotImplementedError`` instead.
``Storage.accessed_time(name)``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.3
Returns a ``datetime`` object containing the last accessed time of the file.
For storage systems that aren't able to return the last accessed time, this
will raise ``NotImplementedError`` instead.
``Storage.created_time(name)``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.3
Returns a ``datetime`` object containing the creation time of the file.
For storage systems that aren't able to return the creation time, this
will raise ``NotImplementedError`` instead.
``Storage.modified_time(name)``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.3
Returns a ``datetime`` object containing the last modified time. For storage
systems that aren't able to return the last modified time, this will raise
``NotImplementedError`` instead.
``Storage.size(name)``
~~~~~~~~~~~~~~~~~~~~~~