

def key(self, *args, **kwargs):
    "\n        Return the cache key to use.\n\n        If you're passing anything but primitive types to the ``get`` method,\n        it's likely that you'll need to override this method.\n        "
    if ((not args) and (not kwargs)):
        return self.class_path
    try:
        if (args and (not kwargs)):
            return ('%s:%s' % (self.class_path, self.hash(args)))
        return ('%s:%s:%s:%s' % (self.class_path, self.hash(args), self.hash(tuple([k for k in sorted(kwargs)])), self.hash(tuple([kwargs[k] for k in sorted(kwargs)]))))
    except TypeError:
        raise RuntimeError('Unable to generate cache key due to unhashableargs or kwargs - you need to implement your ownkey generation method to avoid this problem')

dataset/ETHPy150Open codeinthehole/django-cacheback/cacheback/base.py Job.key/original