def METHOD_NAME(self):
    if not self.name and not self.hostname:
        error_message = [_('At least one of name or hostname is required')]
        raise ValidationError(
            {'name': error_message, 'hostname': error_message}
        )