<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_validator(self, name, validator, *args, **kwargs):
 """ Add the validator to the internal configuration dictionary. :param name: The field machine name to apply the validator on :param validator: The WTForms validator object The rest are optional arguments and keyword arguments that belong to the validator. We let them simply pass through to be checked and bound later. """

        if name in self._dyn_fields:
            if 'validators' in self._dyn_fields[name]:
                self._dyn_fields[name]['validators'].append(validator)
                self._dyn_fields[name][validator.__name__] = {}
                if args:
                    self._dyn_fields[name][validator.__name__]['args'] = args
                if kwargs:
                    self._dyn_fields[name][validator.__name__]['kwargs'] = kwargs
            else:
                self._dyn_fields[name]['validators'] = []
                self.add_validator(name, validator, *args, **kwargs)
        else:
            raise AttributeError('Field "{0}" does not exist. '
                                 'Did you forget to add it?'.format(name))