def clean_fields(self, data):
        """
        For each field, check to see if there is a clean_<name> method.
        If so, run that method and set the returned value on the self.data dict.
        This happens after all validations so that each field can act on the
        cleaned data of other fields if needed.

        :param data: Dictionary of data to clean.
        :return: None
        """
        for name, value in data.items():
            try:
                method = getattr(self, 'clean_{}'.format(name), None)
                if method:
                    self.data[name] = method(value)
            except ValidationError as err:
                self.add_error(name, err)
                continue
def clean_fields ( self , data ) : for name , value in data . items ( ) : try : method = getattr ( self , 'clean_{}' . format ( name ) , None ) if method : self . data [ name ] = method ( value ) except ValidationError as err : self . add_error ( name , err ) continue
For each field, check to see if there is a clean_<name> method.
        If so, run that method and set the returned value on the self.data dict.
        This happens after all validations so that each field can act on the
        cleaned data of other fields if needed.

        :param data: Dictionary of data to clean.
        :return: None