2011-01-08 18:03:27 +08:00
|
|
|
from datetime import datetime
|
2015-01-28 20:35:27 +08:00
|
|
|
|
2012-05-16 19:21:46 +08:00
|
|
|
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
|
2015-01-28 20:35:27 +08:00
|
|
|
from django.core.files import storage
|
2011-01-08 18:03:27 +08:00
|
|
|
|
2013-11-03 05:34:05 +08:00
|
|
|
|
2011-01-08 18:03:27 +08:00
|
|
|
class DummyStorage(storage.Storage):
|
|
|
|
"""
|
|
|
|
A storage class that does implement modified_time() but raises
|
2011-12-28 06:49:24 +08:00
|
|
|
NotImplementedError when calling
|
2011-01-08 18:03:27 +08:00
|
|
|
"""
|
|
|
|
def _save(self, name, content):
|
|
|
|
return 'dummy'
|
|
|
|
|
|
|
|
def delete(self, name):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def exists(self, name):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def modified_time(self, name):
|
|
|
|
return datetime.date(1970, 1, 1)
|
2012-05-16 19:21:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
class SimpleCachedStaticFilesStorage(CachedStaticFilesStorage):
|
|
|
|
|
|
|
|
def file_hash(self, name, content=None):
|
|
|
|
return 'deploy12345'
|