docs: def _set_attribute(self, obj, attr, value):
          """Set an attribute of an object to a specific value.
  
          Return True if the attribute was changed and False otherwise.
          """
          field = obj._meta.get_field(attr)
          if field.max_length is not None and len(value) > field.max_length:
              cleaned_value = value[:field.max_length]
              logger.warn('The attribute "%s" was trimmed from "%s" to "%s"',
                          attr, value, cleaned_value)
          else:
              cleaned_value = value
  
          old_value = getattr(obj, attr)
          if cleaned_value != old_value:
              setattr(obj, attr, cleaned_value)
              return True
  
          return False