Merge pull request #791 from czarneckid/fix-reverse-delete-rule-documentation
Fix the documentation for reverse_delete_rule.
This commit is contained in:
commit
aea400e26a
1
AUTHORS
1
AUTHORS
@ -210,3 +210,4 @@ that much better:
|
|||||||
* Jay Shirley (https://github.com/jshirley)
|
* Jay Shirley (https://github.com/jshirley)
|
||||||
* DavidBord (https://github.com/DavidBord)
|
* DavidBord (https://github.com/DavidBord)
|
||||||
* Axel Haustant (https://github.com/noirbizarre)
|
* Axel Haustant (https://github.com/noirbizarre)
|
||||||
|
* David Czarnecki (https://github.com/czarneckid)
|
||||||
|
@ -56,6 +56,8 @@ Changes in 0.9.X - DEV
|
|||||||
- Allow atomic update for the entire `DictField` #742
|
- Allow atomic update for the entire `DictField` #742
|
||||||
- Added MultiPointField, MultiLineField, MultiPolygonField
|
- Added MultiPointField, MultiLineField, MultiPolygonField
|
||||||
- Fix multiple connections aliases being rewritten #748
|
- Fix multiple connections aliases being rewritten #748
|
||||||
|
- Fixed a few instances where reverse_delete_rule was written as reverse_delete_rules. #791
|
||||||
|
|
||||||
|
|
||||||
Changes in 0.8.7
|
Changes in 0.8.7
|
||||||
================
|
================
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
@ -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`
|
||||||
|
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user