#NEWLINE# @ classmethod #NEWLINE# def forValue( klass , key , value , description ) : #NEWLINE# #INDENT# '\n        Create a L{Field} that can only have a single value.\n\n        @param key: The name of the field, the key which refers to it,\n            e.g. C{"path"}.\n\n        @param value: The allowed value for the field.\n\n        @param description: A description of what this field contains.\n        @type description: C{unicode}\n\n        @return: A L{Field}.\n        ' #NEWLINE# def validate( checked ) : #NEWLINE# #INDENT# if ( checked != value ) : #NEWLINE# #INDENT# raise ValidationError ( checked , ( 'Field %r must be %r' % ( key , value ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return klass ( key , ( lambda _ : value ) , description , klass )