[EMAIL PROTECTED] skrev:
> thanks for your reply! i resolved using this code in the models.py
> before save(): def save(self): if len(self.title)<6: raise
> ValidationError("cannot be blank or small than 6 byte!") it works for
> me!
>
> but i find this code in django-tagging (http://code.google.co
thanks for your reply!
i resolved using this code in the models.py before save():
def save(self):
if len(self.title)<6:
raise ValidationError("cannot be blank or small than 6
byte!")
it works for me!
but i find this code in django-tagging (http://code.go
[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 validate
in django-tagging, i found:
class Tag(models.Model):
"""
A basic tag.
"""
name = models.CharField(max_length=50, unique=True, db_index=True,
validator_list=[isTag])
objects = TagManager()
content from validator.py:
def isTag(field_data, all_data):
"""
Validates that
i used this:
def isBlank(field,all_data):
if field_data is None:
raise ValidattionError(u'Cannot be Blank.')
it not work for me.
should i use if field_data is Blank?
do someone know how to raise a error when the fields is blank? thx
--~--~-~--~~~
5 matches
Mail list logo