Commit Graph
25 Commits
Author SHA1 Message Date
Vincent Driessen 03a757bc6e Add a safety note on using the new delete rules. 2010-12-21 01:19:27 -08:00
Vincent Driessen 0f68df3b4a Fix line width. 2010-12-20 05:55:50 -08:00
Vincent Driessen 07ef58c1a7 Rename delete_rule -> reverse_delete_rule. 2010-12-20 05:55:46 -08:00
Vincent Driessen 52f5deb456 Add documentation for the delete_rule argument. 2010-12-20 05:23:27 -08:00
Vincent Driessen e05e6b89f3 Add safe_update parameter to updates. 2010-12-16 11:54:34 +01:00
Vincent Driessen ffc8b21f67 Some tests broke over the default None value. 2010-12-14 03:50:49 -08:00
Vincent Driessen 16e1f72e65 Avoid confusing semantics when comparing delete rules. 2010-12-14 03:39:14 -08:00
Vincent Driessen 620f4a222e Don't check for DO_NOTHING in the delete rule registration method.
It is already checked before it is invoked.  This saves the ugly import
of DO_NOTHING inside document.py.
2010-12-14 02:03:26 -08:00
Vincent Driessen f30fd71c5e Refactor: put the delete rule constants into the queryset module, too. 2010-12-13 13:42:01 -08:00
Vincent Driessen 3b55deb472 Remove unused meta data. 2010-12-13 13:25:49 -08:00
Vincent Driessen 4d5164c580 Use multiple objects in the test.
This is to ensure only the intended subset is deleted and not all
objects.
2010-12-13 13:24:20 -08:00
Vincent Driessen 5b118f64ec Add tests for nullification and denial on the queryset. 2010-12-13 12:54:26 -08:00
Vincent Driessen 07dae64d66 More the deletion code over to the QuerySet object.
The Document object doens't have any delete_rule specific code anymore,
and leverages the QuerySet's ability to deny/cascade/nullify its
relations.
2010-12-13 12:36:24 -08:00
Vincent Driessen 3c98a4bff5 Remove accidentally left behind debugging message. 2010-12-06 00:07:30 -08:00
Vincent Driessen 20eb920cb4 Change test docstring. 2010-12-06 00:06:03 -08:00
Vincent Driessen b06d794854 Implementation of DENY rules. 2010-12-05 23:43:19 -08:00
Vincent Driessen f3da5bc092 Fix: potential NameError bug in test case. 2010-12-05 23:03:40 -08:00
Vincent Driessen d21434dfd6 Make the nullification an atomic operation.
This shortcut works now, since hmarr fixed the unset bug in dev.
2010-12-05 22:41:16 -08:00
Vincent Driessen ad1aa5bd3e Add tests that need to be satisfied. 2010-12-05 22:24:28 -08:00
Vincent Driessen dd21ce9eac Initial implementation of the NULLIFY rule. 2010-12-05 22:24:27 -08:00
Vincent Driessen bba3aeb4fa Actually *use* the register_delete_rule classmethod, since it's there. 2010-12-05 22:24:27 -08:00
Vincent Driessen 86233bcdf5 Added initial implementation of cascading document deletion.
The current implementation is still very basic and needs some polish.
The essence of it is that each Document gets a new meta attribute called
"delete_rules" that is a dictionary containing (documentclass,
fieldname) as key and the actual delete rule as a value.  (Possible
values are DO_NOTHING, NULLIFY, CASCADE and DENY.  Of those, only
CASCADE is currently implented.)
2010-12-05 22:24:27 -08:00
Vincent Driessen 4f3eacd72c Fix: whitespace.
This broke my Vim auto-folds.
2010-12-05 22:24:27 -08:00
Vincent Driessen 67fcdca6d4 Fix: PyFlakes pointed out this missing import. 2010-12-05 22:24:27 -08:00
Vincent Driessen 62cc8d2ab3 Fix: redefinition of "datetime" from line 6. 2010-12-05 22:24:27 -08:00