Fix the documentation for reverse_delete_rule.

This commit is contained in:
David Czarnecki 2014-10-31 11:40:20 -04:00
parent 158e2a4ca9
commit 4b498ae8cd
3 changed files with 4 additions and 4 deletions

View File

@ -145,7 +145,7 @@ cleaner looking while still allowing manual execution of the callback::
ReferenceFields and Signals ReferenceFields and Signals
--------------------------- ---------------------------
Currently `reverse_delete_rules` do not trigger signals on the other part of Currently `reverse_delete_rule` does not trigger signals on the other part of
the relationship. If this is required you must manually handle the the relationship. If this is required you must manually handle the
reverse deletion. reverse deletion.

View File

@ -859,7 +859,7 @@ class ReferenceField(BaseField):
Use the `reverse_delete_rule` to handle what should happen if the document Use the `reverse_delete_rule` to handle what should happen if the document
the field is referencing is deleted. EmbeddedDocuments, DictFields and the field is referencing is deleted. EmbeddedDocuments, DictFields and
MapFields do not support reverse_delete_rules and an `InvalidDocumentError` MapFields does not support reverse_delete_rule and an `InvalidDocumentError`
will be raised if trying to set on one of these Document / Field types. will be raised if trying to set on one of these Document / Field types.
The options are: The options are:
@ -883,7 +883,7 @@ class ReferenceField(BaseField):
Bar.register_delete_rule(Foo, 'bar', NULLIFY) Bar.register_delete_rule(Foo, 'bar', NULLIFY)
.. note :: .. note ::
`reverse_delete_rules` do not trigger pre / post delete signals to be `reverse_delete_rule` does not trigger pre / post delete signals to be
triggered. triggered.
.. versionchanged:: 0.5 added `reverse_delete_rule` .. versionchanged:: 0.5 added `reverse_delete_rule`

View File

@ -1795,7 +1795,7 @@ class InstanceTest(unittest.TestCase):
self.assertEqual(Bar.objects.count(), 1) # No effect on the BlogPost self.assertEqual(Bar.objects.count(), 1) # No effect on the BlogPost
self.assertEqual(Bar.objects.get().foo, None) self.assertEqual(Bar.objects.get().foo, None)
def test_invalid_reverse_delete_rules_raise_errors(self): def test_invalid_reverse_delete_rule_raise_errors(self):
def throw_invalid_document_error(): def throw_invalid_document_error():
class Blog(Document): class Blog(Document):