(self)
return validate_custom_fields
Returns a validator to be used in bulk import
Returns a validator to be used in bulk import
Returns a validator to be used in bulk import
def get_validator(self):
        """
        Returns a validator to be used in bulk import
        """
        def validate_custom_fields(custom_fields):
            errors = []
            for field in self.get_fields():
                value = custom_fields.get(field.slug, None)
                errors.append(field.validate_required(value))
                errors.append(field.validate_choices(value))
                errors.append(field.validate_regex(value))
            return ' '.join(filter(None, errors))

        return validate_custom_fields
def get_validator ( self ) : def validate_custom_fields ( custom_fields ) : errors = [ ] for field in self . get_fields ( ) : value = custom_fields . get ( field . slug , None ) errors . append ( field . validate_required ( value ) ) errors . append ( field . validate_choices ( value ) ) errors . append ( field . validate_regex ( value ) ) return ' ' . join ( filter ( None , errors ) ) return validate_custom_fields