# Path: rest_framework_extensions/key_constructor/bits.py
# class AllArgsMixin:
# class KeyBitBase:
# class KeyBitDictBase(KeyBitBase):
# class UniqueViewIdKeyBit(KeyBitBase):
# class UniqueMethodIdKeyBit(KeyBitBase):
# class LanguageKeyBit(KeyBitBase):
# class FormatKeyBit(KeyBitBase):
# class UserKeyBit(KeyBitBase):
# class HeadersKeyBit(KeyBitDictBase):
# class RequestMetaKeyBit(KeyBitDictBase):
# class QueryParamsKeyBit(AllArgsMixin, KeyBitDictBase):
# class PaginationKeyBit(QueryParamsKeyBit):
# class SqlQueryKeyBitBase(KeyBitBase):
# class ModelInstanceKeyBitBase(KeyBitBase):
# class ListSqlQueryKeyBit(SqlQueryKeyBitBase):
# class RetrieveSqlQueryKeyBit(SqlQueryKeyBitBase):
# class RetrieveModelKeyBit(ModelInstanceKeyBitBase):
# class ListModelKeyBit(ModelInstanceKeyBitBase):
# class ArgsKeyBit(AllArgsMixin, KeyBitBase):
# class KwargsKeyBit(AllArgsMixin, KeyBitDictBase):
#     def __init__(self, params='*'):
#     def __init__(self, params=None):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def prepare_key_for_value_retrieving(self, key):
#     def prepare_key_for_value_assignment(self, key):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def _get_id_from_user(self, user):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def prepare_key_for_value_retrieving(self, key):
#     def prepare_key_for_value_assignment(self, key):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, **kwargs):
#     def _get_queryset_query_string(self, queryset):
#     def _get_queryset_query_values(self, queryset):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
# 
# Path: rest_framework_extensions/settings.py
# USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK_EXTENSIONS', None)
# DEFAULTS = {
#     # caching
#     'DEFAULT_USE_CACHE': 'default',
#     'DEFAULT_CACHE_RESPONSE_TIMEOUT': None,
#     'DEFAULT_CACHE_ERRORS': True,
#     'DEFAULT_CACHE_KEY_FUNC': 'rest_framework_extensions.utils.default_cache_key_func',
#     'DEFAULT_OBJECT_CACHE_KEY_FUNC': 'rest_framework_extensions.utils.default_object_cache_key_func',
#     'DEFAULT_LIST_CACHE_KEY_FUNC': 'rest_framework_extensions.utils.default_list_cache_key_func',
# 
#     # ETAG
#     'DEFAULT_ETAG_FUNC': 'rest_framework_extensions.utils.default_etag_func',
#     'DEFAULT_OBJECT_ETAG_FUNC': 'rest_framework_extensions.utils.default_object_etag_func',
#     'DEFAULT_LIST_ETAG_FUNC': 'rest_framework_extensions.utils.default_list_etag_func',
# 
#     # API - ETAG
#     'DEFAULT_API_OBJECT_ETAG_FUNC': 'rest_framework_extensions.utils.default_api_object_etag_func',
#     'DEFAULT_API_LIST_ETAG_FUNC': 'rest_framework_extensions.utils.default_api_list_etag_func',
# 
#     # other
#     'DEFAULT_KEY_CONSTRUCTOR_MEMOIZE_FOR_REQUEST': False,
#     'DEFAULT_BULK_OPERATION_HEADER_NAME': 'X-BULK-OPERATION',
#     'DEFAULT_PARENT_LOOKUP_KWARG_NAME_PREFIX': 'parent_lookup_'
# }
# IMPORT_STRINGS = [
#     'DEFAULT_CACHE_KEY_FUNC',
#     'DEFAULT_OBJECT_CACHE_KEY_FUNC',
#     'DEFAULT_LIST_CACHE_KEY_FUNC',
#     'DEFAULT_ETAG_FUNC',
#     'DEFAULT_OBJECT_ETAG_FUNC',
#     'DEFAULT_LIST_ETAG_FUNC',
#     # API - ETAG
#     'DEFAULT_API_OBJECT_ETAG_FUNC',
#     'DEFAULT_API_LIST_ETAG_FUNC',
# ]


import hashlib
import json
from rest_framework_extensions.key_constructor import bits
from rest_framework_extensions.settings import extensions_api_settings
        from rest_framework_extensions.utils import get_unique_method_id



class KeyConstructor:
    def __init__(self, memoize_for_request=None, params=None):
        if memoize_for_request is None:
            self.memoize_for_request = extensions_api_settings.DEFAULT_KEY_CONSTRUCTOR_MEMOIZE_FOR_REQUEST

# Path: rest_framework_extensions/key_constructor/bits.py
# class AllArgsMixin:
# class KeyBitBase:
# class KeyBitDictBase(KeyBitBase):
# class UniqueViewIdKeyBit(KeyBitBase):
# class UniqueMethodIdKeyBit(KeyBitBase):
# class LanguageKeyBit(KeyBitBase):
# class FormatKeyBit(KeyBitBase):
# class UserKeyBit(KeyBitBase):
# class HeadersKeyBit(KeyBitDictBase):
# class RequestMetaKeyBit(KeyBitDictBase):
# class QueryParamsKeyBit(AllArgsMixin, KeyBitDictBase):
# class PaginationKeyBit(QueryParamsKeyBit):
# class SqlQueryKeyBitBase(KeyBitBase):
# class ModelInstanceKeyBitBase(KeyBitBase):
# class ListSqlQueryKeyBit(SqlQueryKeyBitBase):
# class RetrieveSqlQueryKeyBit(SqlQueryKeyBitBase):
# class RetrieveModelKeyBit(ModelInstanceKeyBitBase):
# class ListModelKeyBit(ModelInstanceKeyBitBase):
# class ArgsKeyBit(AllArgsMixin, KeyBitBase):
# class KwargsKeyBit(AllArgsMixin, KeyBitDictBase):
#     def __init__(self, params='*'):
#     def __init__(self, params=None):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def prepare_key_for_value_retrieving(self, key):
#     def prepare_key_for_value_assignment(self, key):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def _get_id_from_user(self, user):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def prepare_key_for_value_retrieving(self, key):
#     def prepare_key_for_value_assignment(self, key):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, **kwargs):
#     def _get_queryset_query_string(self, queryset):
#     def _get_queryset_query_values(self, queryset):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_data(self, params, view_instance, view_method, request, args, kwargs):
#     def get_source_dict(self, params, view_instance, view_method, request, args, kwargs):
# 
# Path: rest_framework_extensions/settings.py
# USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK_EXTENSIONS', None)
# DEFAULTS = {
#     # caching
#     'DEFAULT_USE_CACHE': 'default',
#     'DEFAULT_CACHE_RESPONSE_TIMEOUT': None,
#     'DEFAULT_CACHE_ERRORS': True,
#     'DEFAULT_CACHE_KEY_FUNC': 'rest_framework_extensions.utils.default_cache_key_func',
#     'DEFAULT_OBJECT_CACHE_KEY_FUNC': 'rest_framework_extensions.utils.default_object_cache_key_func',
#     'DEFAULT_LIST_CACHE_KEY_FUNC': 'rest_framework_extensions.utils.default_list_cache_key_func',
# 
#     # ETAG
#     'DEFAULT_ETAG_FUNC': 'rest_framework_extensions.utils.default_etag_func',
#     'DEFAULT_OBJECT_ETAG_FUNC': 'rest_framework_extensions.utils.default_object_etag_func',
#     'DEFAULT_LIST_ETAG_FUNC': 'rest_framework_extensions.utils.default_list_etag_func',
# 
#     # API - ETAG
#     'DEFAULT_API_OBJECT_ETAG_FUNC': 'rest_framework_extensions.utils.default_api_object_etag_func',
#     'DEFAULT_API_LIST_ETAG_FUNC': 'rest_framework_extensions.utils.default_api_list_etag_func',
# 
#     # other
#     'DEFAULT_KEY_CONSTRUCTOR_MEMOIZE_FOR_REQUEST': False,
#     'DEFAULT_BULK_OPERATION_HEADER_NAME': 'X-BULK-OPERATION',
#     'DEFAULT_PARENT_LOOKUP_KWARG_NAME_PREFIX': 'parent_lookup_'
# }
# IMPORT_STRINGS = [
#     'DEFAULT_CACHE_KEY_FUNC',
#     'DEFAULT_OBJECT_CACHE_KEY_FUNC',
#     'DEFAULT_LIST_CACHE_KEY_FUNC',
#     'DEFAULT_ETAG_FUNC',
#     'DEFAULT_OBJECT_ETAG_FUNC',
#     'DEFAULT_LIST_ETAG_FUNC',
#     # API - ETAG
#     'DEFAULT_API_OBJECT_ETAG_FUNC',
#     'DEFAULT_API_LIST_ETAG_FUNC',
# ]


# Path: rest_framework_extensions/key_constructor/constructors.py
import hashlib
import json
from rest_framework_extensions.key_constructor import bits
from rest_framework_extensions.settings import extensions_api_settings
        from rest_framework_extensions.utils import get_unique_method_id




class KeyConstructor:
    def __init__(self, memoize_for_request=None, params=None):
        if memoize_for_request is None:
            self.memoize_for_request = extensions_api_settings.DEFAULT_KEY_CONSTRUCTOR_MEMOIZE_FOR_REQUEST

        else: