From 726d1e3a22f9fc86f0ba25254ad10f66f01d9810 Mon Sep 17 00:00:00 2001 From: Stefan Pratter Date: Sat, 29 Dec 2018 21:19:12 +0000 Subject: [PATCH] how to use the undelete command --- docs/commands.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/commands.md diff --git a/docs/commands.md b/docs/commands.md new file mode 100644 index 00000000..554ec73d --- /dev/null +++ b/docs/commands.md @@ -0,0 +1,29 @@ +## undelete + +First find out the version id when the object was deleted + +``` +python manage.py pdb_reversion_inspect +``` + +``` +VERSION: 7 (392112) - 2018-12-24T07:13:49.612Z - User: XXX +status: 'ok' => 'deleted' +``` + +You want the number inside the brackets (in this case *392112*) + +Then run the undelete command + +``` +python manage.py pdb_undelete +``` + +This will show you everthing that will be undeleted, it will run in pretend mode, nothing +is committed yet. + +After reviewing, run the command again with the `--commit` flag + +``` +python manage.py pdb_undelete --commit +```