def __setitem__(self, field, value) :
        """Set an element in the store"""
        if (not self.collection._validation['allow_foreign_fields']) and (field not in self.validators) and (field not in self.collection.arangoPrivates):
            raise SchemaViolation(self.collection.__class__, field)
        
        if field in self.collection.arangoPrivates :
            raise ValueError("DocumentStore cannot contain private field (got %s)" % field)

        if isinstance(value, dict) :
            if field in self.validators and isinstance(self.validators[field], dict):
                vals = self.validators[field]
            else :
                vals = {}
            self.store[field] = DocumentStore(self.collection, validators = vals, initDct = value, patch = self.patching, subStore=True, validateInit=self.validateInit)
            
            self.subStores[field] = self.store[field]
        else :
            self.store[field] = value

        if self.patching :
            self.patchStore[field] = self.store[field]

        if self.mustValidate and self.collection._validation['on_set'] :
            self.validateField(field)
def __setitem__ ( self , field , value ) : if ( not self . collection . _validation [ 'allow_foreign_fields' ] ) and ( field not in self . validators ) and ( field not in self . collection . arangoPrivates ) : raise SchemaViolation ( self . collection . __class__ , field ) if field in self . collection . arangoPrivates : raise ValueError ( "DocumentStore cannot contain private field (got %s)" % field ) if isinstance ( value , dict ) : if field in self . validators and isinstance ( self . validators [ field ] , dict ) : vals = self . validators [ field ] else : vals = { } self . store [ field ] = DocumentStore ( self . collection , validators = vals , initDct = value , patch = self . patching , subStore = True , validateInit = self . validateInit ) self . subStores [ field ] = self . store [ field ] else : self . store [ field ] = value if self . patching : self . patchStore [ field ] = self . store [ field ] if self . mustValidate and self . collection . _validation [ 'on_set' ] : self . validateField ( field )
Set an element in the store