Ticket #10497: storage-stat.2.diff

File storage-stat.2.diff, 874 bytes (added by HuCy, 16 years ago)
  • django/core/files/storage.py

     
    116116        """
    117117        raise NotImplementedError()
    118118
     119    def stat(self, name):
     120        """
     121        Returns a os.stat like result.
     122        """
     123        raise NotImplementedError()
     124
    119125class FileSystemStorage(Storage):
    120126    """
    121127    Standard filesystem storage
     
    212218            raise ValueError("This file is not accessible via a URL.")
    213219        return urlparse.urljoin(self.base_url, name).replace('\\', '/')
    214220
     221    def stat(self, name):
     222        """
     223        Returns a os.stat like result.
     224        """
     225        return os.stat(self.path(name))
     226
    215227def get_storage_class(import_path):
    216228    try:
    217229        dot = import_path.rindex('.')
Back to Top