@Clivern I saw the docs on th GitHub Pages and there is some example code I think its wrong :
from pyvalitron.form import Form
form = Form({
'test_field1': {
'value': 'Hello World',
'validate': {
'length_between': {
'param': [1, 12],
'error': 'Input lenght must be between 1 and 12 characters'
}
}
},
'test_field2': {
'value': 'Hello World',
'validate': {
'length_between': {
'param': [1, 9],
'error': 'Input lenght must be between 1 and 12 characters'
}
}
}
})
form.process()
errors = form.get_errors()
print(errors['test_field2']) # Input lenght must be between 1 and 12 characters
I don't know how the code works but won't it be something like that :
from pyvalitron.form import Form
form = Form({
'test_field1': {
'value': 'Hello World',
'validate': {
'length_between': {
'param': [1, 12],
'error': 'Input lenght must be between 1 and 12 characters'
}
}
},
'test_field2': {
'value': 'Hello World',
'validate': {
'length_between': {
'param': [1, 9], # I guess that means that it must be from 1 to 9
'error': 'Input lenght must be between 1 and 9 characters'
}
}
}
})
form.process()
errors = form.get_errors()
print(errors['test_field2']) # Input lenght must be between 1 and 9 characters
@Clivern I saw the docs on th GitHub Pages and there is some example code I think its wrong :
I don't know how the code works but won't it be something like that :