[EMAIL PROTECTED] skrev:
> i used this: def isBlank(field,all_data): if field_data is None:
> raise ValidattionError(u'Cannot be Blank.')
>
> it not work for me.
It seems you are being bitten by the behavior described thus in the
documentation:
"""
After a form has been submitted, Django validates each field in turn.
First, if the field is required, Django checks that it is present and
non-empty. Then, if that test passes /and the form submission contained
data/ for that field, all the validators for that field are called in
turn. The emphasized portion in the last sentence is important: if a
form field is not submitted (because it contains no data -- which is
normal HTML behavior), the validators are not run against the field.
...
If you would like your validator to run /always/, regardless of whether
its attached field contains any data, set the always_test attribute on
the validator function. For example:
def my_custom_validator(field_data, all_data):
# ...
my_custom_validator.always_test = True
"""
--
Nis Jorgensen
Handcrafting signatures since 1996
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---