def get_combination_hash_from_variable_mapping(parent, variables):
 mapping = {}
 for (variable_identifier, value_identifier) in variables.items():
  (variable, _) = ProductVariationVariable.objects.get_or_create(product=parent, identifier=force_text(variable_identifier))
  (value, _) = ProductVariationVariableValue.objects.get_or_create(variable=variable, identifier=force_text(value_identifier))
  mapping[variable] = value
 return hash_combination(mapping)

def get_combination_hash_from_variable_mapping ( parent , variables ) : mapping = { } for ( variable_identifier , value_identifier ) in variables . items ( ) : ( variable , _ ) = ProductVariationVariable . objects . get_or_create ( product = parent , identifier = force_text ( variable_identifier ) ) ( value , _ ) = ProductVariationVariableValue . objects . get_or_create ( variable = variable , identifier = force_text ( value_identifier ) ) mapping [ variable ] = value return hash_combination ( mapping )
create a combination hash from a mapping of variable identifiers to value identifiers .