def validate_greater_than(fieldname):
 def _validator(form, field):
  try:
   other = form[fieldname]
  except KeyError:
   raise validators.ValidationError((field.gettext(u"Invalid field name '%s'.") % fieldname))
  if ((field.data != '') and (field.data < other.data)):
   message = field.gettext((u'Field must be greater than %s.' % fieldname))
   raise validators.ValidationError(message)
 return _validator

def validate_greater_than ( fieldname ) : def _validator ( form , field ) : try : other = form [ fieldname ] except KeyError : raise validators . ValidationError ( ( field . gettext ( u"Invalid field name '%s'." ) % fieldname ) ) if ( ( field . data != '' ) and ( field . data < other . data ) ) : message = field . gettext ( ( u'Field must be greater than %s.' % fieldname ) ) raise validators . ValidationError ( message ) return _validator
compares the value of two fields the value of self is to be greater than the supplied field .