  def get_url_kwargs(model_field):
      return {
          'view_name': get_detail_view_name(model_field)
      }
 
</s> remove         unique_error_message = model_field.error_messages.get('unique', None)
        if unique_error_message:
            unique_error_message = unique_error_message % {
                'model_name': model_field.model._meta.verbose_name,
                'field_label': model_field.verbose_name
            }
 </s> add  </s> remove             validator = UniqueValidator(queryset=model_field.model._default_manager)
 </s> add             validator = UniqueValidator(
                queryset=model_field.model._default_manager,
                message=get_unique_error_message(model_field)) </s> remove             message=unique_error_message)
 </s> add             message=get_unique_error_message(model_field))
def get_unique_error_message(model_field):
    unique_error_message = model_field.error_messages.get('unique', None)
    if unique_error_message:
        unique_error_message = unique_error_message % {
            'model_name': model_field.model._meta.verbose_name,
            'field_label': model_field.verbose_name
        }
    return unique_error_message
  def get_url_kwargs(model_field):
      return {
          'view_name': get_detail_view_name(model_field)
      }
def get_unique_error_message(model_field):
    unique_error_message = model_field.error_messages.get('unique', None)
    if unique_error_message:
        unique_error_message = unique_error_message % {
            'model_name': model_field.model._meta.verbose_name,
            'field_label': model_field.verbose_name
        }
    return unique_error_message
keep keep keep add
 Respect model error_messages for relation (#7599) 
rest_framework/utils/field_mapping.py