docs: use explicit register_delete_rule example
The previous example of creating bi-directional delete rules was vague since the example defined only one class and the relationship between "Foo" and "Bar" wasn't clear. I added a more explicit example where the relationship between the two classes is explicit.
This commit is contained in:
		@@ -971,11 +971,13 @@ class ReferenceField(BaseField):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    .. code-block:: python
 | 
					    .. code-block:: python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        class Bar(Document):
 | 
					        class Org(Document):
 | 
				
			||||||
            content = StringField()
 | 
					            owner = ReferenceField('User')
 | 
				
			||||||
            foo = ReferenceField('Foo')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Foo.register_delete_rule(Bar, 'foo', NULLIFY)
 | 
					        class User(Document):
 | 
				
			||||||
 | 
					            org = ReferenceField('Org', reverse_delete_rule=CASCADE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        User.register_delete_rule(Org, 'owner', DENY)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .. versionchanged:: 0.5 added `reverse_delete_rule`
 | 
					    .. versionchanged:: 0.5 added `reverse_delete_rule`
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user