(self, field, id, REQUEST, sub_field_property_dict)
Validates a subfield (as part of field validation).
Validates a subfield (as part of field validation).
Validates a subfield ( as part of field validation ) .
def validate_sub_field(self, field, id, REQUEST, sub_field_property_dict):
    """
    Validates a subfield (as part of field validation).
    """
    try:
      for parameter in ('title', 'required', 'size'):
        REQUEST.set(KEYWORD % parameter, sub_field_property_dict[parameter])
      REQUEST.set(KEYWORD % 'default', "")
      REQUEST.set(KEYWORD % 'items', sub_field_property_dict['item_list'])
      field_type = sub_field_property_dict['field_type']
      if id[-5:] == ':list':
        id = id[:-5]
        field_type = 'Multi' + field_type
        REQUEST.set(id, [x for x in REQUEST.get(id, ()) if x != ''])
      return self.sub_validator[field_type].validate(field, id, REQUEST)
    finally:
      for parameter in ('title', 'required', 'size', 'default', 'first_item',
                        'items'):
        # As it doesn't seem possible to delete value in the REQUEST,
        # use a marker
        REQUEST.set(KEYWORD % parameter, MARKER)
def validate_sub_field ( self , field , id , REQUEST , sub_field_property_dict ) : try : for parameter in ( 'title' , 'required' , 'size' ) : REQUEST . set ( KEYWORD % parameter , sub_field_property_dict [ parameter ] ) REQUEST . set ( KEYWORD % 'default' , "" ) REQUEST . set ( KEYWORD % 'items' , sub_field_property_dict [ 'item_list' ] ) field_type = sub_field_property_dict [ 'field_type' ] if id [ - 5 : ] == ':list' : id = id [ : - 5 ] field_type = 'Multi' + field_type REQUEST . set ( id , [ x for x in REQUEST . get ( id , ( ) ) if x != '' ] ) return self . sub_validator [ field_type ] . validate ( field , id , REQUEST ) finally : for parameter in ( 'title' , 'required' , 'size' , 'default' , 'first_item' , 'items' ) : # As it doesn't seem possible to delete value in the REQUEST, # use a marker REQUEST . set ( KEYWORD % parameter , MARKER )