You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a custom manager which caches get() and get_or_create() functions. Everything works just fine, but I'd like to use different timeouts for different models which use this manager. Consider the following example:
....
File "/usr/lib/python2.7/site-packages/django_memoize-1.2.0-py2.7.egg/memoize/__init__.py", line 239, in _memoize_kwargs_to_args
arg = repr(args[0])
IndexError: tuple index out of range
I created a patch - seems to work for me, but I'm not sure if it won't break anything else:
diff -rup django_memoize-1.2.0-py2.7.egg.orig/memoize/__init__.py django_memoize-1.2.0-py2.7.egg/memoize/__init__.py
--- django_memoize-1.2.0-py2.7.egg.orig/memoize/__init__.py 2015-10-16 22:13:33.460610061 +0200
+++ django_memoize-1.2.0-py2.7.egg/memoize/__init__.py 2015-10-17 11:52:56.327081228 +0200
@@ -236,7 +236,7 @@ class Memoizer(object):
#: this supports instance methods for
#: the memoized functions, giving more
#: flexibility to developers
- arg = repr(args[0])
+ arg = repr(argspec.args[i])
arg_num += 1
elif argspec.args[i] in kwargs:
arg = kwargs.pop(argspec.args[i])
The text was updated successfully, but these errors were encountered:
Hi,
I created a custom manager which caches get() and get_or_create() functions. Everything works just fine, but I'd like to use different timeouts for different models which use this manager. Consider the following example:
This raises IndexError:
I created a patch - seems to work for me, but I'm not sure if it won't break anything else:
The text was updated successfully, but these errors were encountered: