Ticket #10497: storage-stat.diff
File storage-stat.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/core/files/storage.py
116 116 """ 117 117 raise NotImplementedError() 118 118 119 def stat(self, name): 120 """ 121 Returns a os.stat like result. 122 """ 123 raise NotImplementedError() 124 119 125 class FileSystemStorage(Storage): 120 126 """ 121 127 Standard filesystem storage … … 212 218 raise ValueError("This file is not accessible via a URL.") 213 219 return urlparse.urljoin(self.base_url, name).replace('\\', '/') 214 220 221 def stat(self, name): 222 """ 223 Returns a os.stat like result. 224 """ 225 return os.stat(self.path(name)) 226 215 227 def get_storage_class(import_path): 216 228 try: 217 229 dot = import_path.rindex('.') -
django/template/defaultfilters.py
285 285 upper.is_safe = False 286 286 upper = stringfilter(upper) 287 287 288 def urlencode(value ):288 def urlencode(value, arg): 289 289 """Escapes a value for use in a URL.""" 290 290 from django.utils.http import urlquote 291 if arg: 292 return urlquote(value, safe=arg) 291 293 return urlquote(value) 292 294 urlencode.is_safe = False 293 295 urlencode = stringfilter(urlencode)