def METHOD_NAME(self, attrs, source):
    # values must be a dict
    data_values = attrs.get("attributes_values", None)
    if self.object:
        data_values = (data_values or self.object.attributes_values)
    if type(data_values) is not dict:
        raise ValidationError(_("Invalid content. It must be {\"key\": \"value\",...}"))
    # Values keys must be in the container object project
    data_container = attrs.get(self._container_field, None)
    if data_container:
        project_id = data_container.project_id
    elif self.object:
        project_id = getattr(self.object, self._container_field).project_id
    else:
        project_id = None
    values_ids = list(data_values.keys())
    qs = self._custom_attribute_model.objects.filter(project=project_id,
                                                     id__in=values_ids)
    if qs.count() != len(values_ids):
        raise ValidationError(_("It contains invalid custom fields."))
    return attrs