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 ``field_data`` is a valid tag name.
    """
    if field_data is not None:
        field_data = smart_unicode(field_data)
    if not tag_re.match(field_data):
        raise ValidationError(u'Tag names must contain only unicode
alphanumeric characters, numbers, underscores or hyphens.')


but this did not work for me.

On 9月8日, 上午9时21分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 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


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to