def IntegerValidator(min, max):
    def _validator(value):
        try:
            int(value)
            if value < min:
                raise forms.ValidationError(_("Minimum is %d" % min))
            elif value > max:
                raise forms.ValidationError(_("Maximum is %d" % max))
        except TypeError:
            raise forms.ValidationError(_("Must be a number"))
        return value
    return _validator
Factory function, returns validator method processing integers.
dataset/ETHPy150Open lukaszb/django-projector/projector/utils/validators.py/IntegerValidator