Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#657 closed defect (wontfix)

validator - characters without numbers

Reported by: Bless Owned by: Adrian Holovaty
Component: Validators Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It should be a validator for characters without numbers, because is possible that you want whatever text minus numbers.

num_re = re.compile(r'\d')

def thereisNumeric:
    if num_re.search(field_data):
        raise ValidationError, "This value musn't contain numbers."

Change History (6)

comment:1 by anonymous, 19 years ago

Component: Admin interfaceValidators

comment:2 by BleSS, 19 years ago

Examples of field data:

"foo bar" -> validators.isOnlyLetters fails by the space
"foo-bar"
"foo;bar"

comment:3 by Adrian Holovaty, 19 years ago

Resolution: wontfix
Status: newclosed

This is a bit too obscure for inclusion in the standard validator library, I think. Feel free to write your own validator and use it within your own code.

comment:4 by BleSS, 19 years ago

Resolution: wontfix
Status: closedreopened

I believe that now it's more clear

num_re = re.compile(r'\d')

def isCharacterNotNumeric(field_data, all_data):
    if num_re.search(field_data):
        raise ValidationError, "This value must not contain numbers."

I think that it would be useful

comment:5 by BleSS, 19 years ago

I wrote wrong the raise

        raise ValidationError, "This value must not contain numeric characters."

comment:6 by BleSS, 19 years ago

Resolution: wontfix
Status: reopenedclosed

adrian, you had reason. I'll use my own validator.

Note: See TracTickets for help on using tickets.
Back to Top