Commits

Anonymous committed 2a3f281

fix cache backends to work with Django 1.3 by adding kwargs, without breaking backwards compatibility.

Comments (0)

Files changed (2)

johnny/backends/filebased.py

 # perform a call to md5 that chokes on that type of input;  we'll just not
 # fret the encoding, and things will work alright even with unicode table names
 class CacheClass(filebased.CacheClass):
-    def add(self, key, value, timeout=None):
+    def add(self, key, value, timeout=None, **kwargs):
         if timeout is 0:
             timeout = sys.maxint
-        return super(CacheClass, self).add(key, value, timeout)
+        return super(CacheClass, self).add(key, value, timeout=timeout, **kwargs)
 
     def set(self, key, value, timeout=None):
         if timeout is 0:
             timeout = sys.maxint
-        return super(CacheClass, self).set(key, value, timeout)
+        return super(CacheClass, self).set(key, value, timeout=timeout, **kwargs)
 
 if django.VERSION[:2] > (1, 2):
     class FileBasedCache(CacheClass):

johnny/backends/locmem.py

 import sys
 
 class CacheClass(locmem.CacheClass):
-    def add(self, key, value, timeout=None):
+    def add(self, key, value, timeout=None, **kwargs):
         if timeout is 0:
             timeout = sys.maxint
-        return super(CacheClass, self).add(smart_str(key), value, timeout)
+        return super(CacheClass, self).add(smart_str(key), value, timeout=timeout, **kwargs)
 
-    def set(self, key, value, timeout=None):
+    def set(self, key, value, timeout=None, **kwargs):
         if timeout is 0:
             timeout = sys.maxint
-        return super(CacheClass, self).set(smart_str(key), value, timeout)
+        return super(CacheClass, self).set(smart_str(key), value, timeout=timeout, **kwargs)
 
 if django.VERSION[:2] > (1, 2):
     class LocMemCache(CacheClass):