Beispiel #1
0
def maxPhotoSize(value):
    if value is not None:
        if value.getSize()/1024 > 512:
            raise schema.ValidationError(_(u"Please upload image smaller than 512KB"))
Beispiel #2
0
def emailValidator(value):
    try:
        return checkEmailAddress(value)
    except:
        raise Invalid(_(u"Invalid email address"))
Beispiel #3
0
 def validateStartEnd(data):
     if data.start is not None and data.end is not None:
         if data.start > data.end:
             raise StartBeforeEnd(_(
                 u"The start date must be before the end date."))