def __setitem__(self, name, value):
        """ Dictionary-style field setter.
        :param name: field_name of the field (not the name of the Document's attribute)
        :param value: value to set
        :raise KeyError if the given name is not among known field_names
        """
        if name not in self._fields:
            raise KeyError(name)
        field_obj = self._fields[name]
        return field_obj.__set__(self, value)
def __setitem__ ( self , name , value ) : if name not in self . _fields : raise KeyError ( name ) field_obj = self . _fields [ name ] return field_obj . __set__ ( self , value )
Dictionary-style field setter.
        :param name: field_name of the field (not the name of the Document's attribute)
        :param value: value to set
        :raise KeyError if the given name is not among known field_names