def _get_cache_key(self, obj):
        """Derive cache key for given object."""
        if obj is not None:
            # Make sure that key is REALLY unique.
            return '{}-{}'.format(id(self), obj.pk)

        return "{}-None".format(id(self))
def _get_cache_key ( self , obj ) : if obj is not None : return '{}-{}' . format ( id ( self ) , obj . pk ) return "{}-None" . format ( id ( self ) )
Derive cache key for given object.