Ticket #10497: storage-stat.diff

File storage-stat.diff, 1.4 KB (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('.')
  • django/template/defaultfilters.py

     
    285285upper.is_safe = False
    286286upper = stringfilter(upper)
    287287
    288 def urlencode(value):
     288def urlencode(value, arg):
    289289    """Escapes a value for use in a URL."""
    290290    from django.utils.http import urlquote
     291    if arg:
     292        return urlquote(value, safe=arg)
    291293    return urlquote(value)
    292294urlencode.is_safe = False
    293295urlencode = stringfilter(urlencode)
Back to Top