Commit bcc4439c16c15aa86c712b3f3f8322475fdda832
1 parent
4f57a60c
Exists in
master
and in
2 other branches
Subject restore capable of reading file. Still have to work on how to manage dat…
…a conflict and save it on database
Showing
2 changed files
with
44 additions
and
16 deletions
Show diff stats
backup.json
1 | -[{"id": 1, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 44, "name": "rvenge"}, {"id": 45, "name": "destruct"}], "pendencies_resource": [{"id": 1, "action": "create", "begin_date": "2017-01-21T23:35:00Z", "end_date": null, "limit_date": null}, {"id": 2, "action": "view", "begin_date": "2017-01-20T23:35:00Z", "end_date": "2017-01-31T23:35:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Revenge", "slug": "revenge", "brief_description": "<p>Here Comes</p>", "show_window": false, "all_students": false, "visible": true, "order": 1, "create_date": "2017-01-20T22:42:16.126657Z", "last_update": "2017-01-30T18:39:30.100600Z", "content": "<p>Listen Dammit</p><p>I do know how to make it better thoug</p>"}, {"id": 14, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 58, "name": "survive"}, {"id": 59, "name": "brave"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Care", "slug": "care", "brief_description": "<p>One last minute</p>", "show_window": true, "all_students": false, "visible": true, "order": 2, "create_date": "2017-01-23T17:59:10.053614Z", "last_update": "2017-01-24T21:53:17.119881Z", "content": "You don't really"}, {"id": 3, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 44, "name": "rvenge"}, {"id": 45, "name": "destruct"}], "pendencies_resource": [{"id": 5, "action": "create", "begin_date": "2017-01-24T23:35:00Z", "end_date": null, "limit_date": null}, {"id": 6, "action": "view", "begin_date": "2017-01-24T23:35:00Z", "end_date": "2017-01-31T23:35:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Teste 2", "slug": "teste-2", "brief_description": "<p>Here Comes</p>", "show_window": true, "all_students": false, "visible": true, "order": 3, "create_date": "2017-01-23T17:17:28.416904Z", "last_update": "2017-01-24T21:53:17.131082Z", "content": "Listen Dammit"}, {"id": 4, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 46, "name": "tears"}, {"id": 47, "name": "rain"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Have", "slug": "have", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 5, "create_date": "2017-01-23T17:31:58.957439Z", "last_update": "2017-01-24T21:53:17.155196Z", "content": "Haven't"}, {"id": 21, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 71, "name": "candle"}, {"id": 72, "name": "mass"}], "pendencies_resource": [{"id": 7, "action": "view", "begin_date": "2017-01-25T04:07:00Z", "end_date": "2017-02-02T04:07:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Each small candle", "slug": "each-small-candle", "brief_description": "<p>Uhuh</p>", "show_window": false, "all_students": false, "visible": true, "order": 6, "create_date": "2017-01-24T03:16:17.180365Z", "last_update": "2017-01-24T21:53:17.164135Z", "content": "<p>Lights a corner of the dark</p>"}, {"id": 5, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 46, "name": "tears"}, {"id": 47, "name": "rain"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Lose you", "slug": "lose-you", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 7, "create_date": "2017-01-23T17:34:29.313661Z", "last_update": "2017-01-24T21:53:17.175261Z", "content": "Haven't <b>you heard <i>about the sirens <u>going down</u></i></b>"}, {"id": 16, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 62, "name": "sing"}, {"id": 63, "name": "loud"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Sing", "slug": "sing", "brief_description": "<p>Talking about</p>", "show_window": false, "all_students": false, "visible": false, "order": 8, "create_date": "2017-01-23T22:10:39.437832Z", "last_update": "2017-01-24T21:53:17.197911Z", "content": "Sing sing"}, {"id": 49, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [{"id": 22, "action": "view", "begin_date": "2017-01-31T19:38:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Testes", "slug": "testes", "brief_description": "<p>asd</p>", "show_window": false, "all_students": false, "visible": true, "order": 9, "create_date": "2017-01-30T18:38:25.741186Z", "last_update": "2017-01-30T18:38:25.878442Z", "content": "<p>COmon</p>"}, {"id": 50, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [{"id": 23, "action": "view", "begin_date": "2017-02-03T19:38:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Yellow", "slug": "yellow", "brief_description": "<p>Vber</p>", "show_window": false, "all_students": false, "visible": true, "order": 10, "create_date": "2017-01-30T18:39:04.914450Z", "last_update": "2017-01-30T18:39:05.212499Z", "content": "<p>Flicker Berat</p>"}, {"id": 58, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 112, "name": "castle"}], "pendencies_resource": [{"id": 27, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Berry the castle", "slug": "berry-the-castle", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 15, "create_date": "2017-02-23T15:22:21.044556Z", "last_update": "2017-02-23T15:22:21.371782Z", "content": "<p>Crush crush crush<br></p>"}, {"id": 59, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 109, "name": "teste"}], "pendencies_resource": [{"id": 28, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "What you get", "slug": "what-you-get", "brief_description": "<p>To me</p>", "show_window": false, "all_students": true, "visible": true, "order": 16, "create_date": "2017-02-23T15:23:56.414396Z", "last_update": "2017-02-23T15:23:56.482582Z", "content": "<p>Let your heart with</p>"}, {"id": 66, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 116, "name": "Lord"}], "pendencies_resource": [{"id": 30, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Last Stand", "slug": "last-stand", "brief_description": "<p>For the grace of the might of the Lord </p>", "show_window": false, "all_students": true, "visible": true, "order": 17, "create_date": "2017-02-24T20:31:26.650857Z", "last_update": "2017-02-24T20:31:26.778340Z", "content": "<p>Twenty Seven</p>"}, {"id": 68, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 118, "name": "calling"}], "pendencies_resource": [{"id": 31, "action": "view", "begin_date": "2017-02-28T23:01:00Z", "end_date": "2017-03-01T23:02:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Angels calling", "slug": "angels-calling", "brief_description": "<p>Falling</p>", "show_window": false, "all_students": true, "visible": true, "order": 18, "create_date": "2017-02-24T20:47:51.687147Z", "last_update": "2017-02-25T01:35:19.427849Z", "content": "<p>Your name</p>"}][{"id": 51, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 103, "name": "mirror"}, {"id": 104, "name": "to do"}], "pendencies_resource": [{"id": 24, "action": "view", "begin_date": "2017-02-01T21:59:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "ytvideo", "name": "System", "slug": "system", "brief_description": "<p>Gotta</p>", "show_window": true, "all_students": true, "visible": true, "order": 11, "create_date": "2017-02-01T21:03:21.123568Z", "last_update": "2017-02-02T23:08:32.570997Z", "url": "https://www.youtube.com/embed/qOrXWhmUbJ0"}][{"id": 40, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 91, "name": "end"}, {"id": 92, "name": "tonight"}], "pendencies_resource": [{"id": 21, "action": "view", "begin_date": "2017-01-31T19:33:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "filelink", "name": "Alive", "slug": "alive", "brief_description": "<p>Nothern lights</p><p>I'm still</p>", "show_window": true, "all_students": true, "visible": true, "order": 4, "create_date": "2017-01-24T21:52:58.028122Z", "last_update": "2017-01-30T18:33:25.804307Z", "file_content": "/uploads/files/index.html"}, {"id": 73, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 125, "name": "Zafkiel"}], "pendencies_resource": [], "_my_subclass": "filelink", "name": "Lies", "slug": "lies", "brief_description": "", "show_window": false, "all_students": false, "visible": true, "order": 20, "create_date": "2017-04-26T03:03:38.089353Z", "last_update": "2017-04-26T03:03:38.531148Z", "file_content": "/uploads/files/kurumi.png"}][{"id": 53, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 106, "name": "otherside"}], "pendencies_resource": [], "_my_subclass": "link", "name": "Sorry", "slug": "sorry", "brief_description": "<p>Hellor</p>", "show_window": false, "all_students": true, "visible": true, "order": 12, "create_date": "2017-02-02T18:59:06.159653Z", "last_update": "2017-02-02T18:59:06.270167Z", "link_url": "https://www.youtube.com/embed/qOrXWhmUbJ0"}, {"id": 57, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 109, "name": "teste"}], "pendencies_resource": [], "_my_subclass": "link", "name": "Unravel", "slug": "unravel", "brief_description": "<p>Co asseru</p>", "show_window": true, "all_students": true, "visible": true, "order": 14, "create_date": "2017-02-12T04:18:39.836818Z", "last_update": "2017-02-12T04:18:40.083226Z", "link_url": "http://stackoverflow.com/questions/813418/django-set-field-value-after-a-form-is-initialized"}][{"id": 56, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [], "_my_subclass": "pdffile", "name": "Legend", "slug": "legend", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 13, "create_date": "2017-02-09T18:29:12.935873Z", "last_update": "2017-02-09T18:29:13.410469Z", "file": "/uploads/files/egz_Ez4GoPW.pdf"}][{"id": 70, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 121, "name": "megumin"}, {"id": 122, "name": "kurumin"}], "item_goal": [{"id": 3, "description": "Let me go", "ref_value": 57, "order": 1}, {"id": 4, "description": "Run away", "ref_value": 70, "order": 2}, {"id": 5, "description": "Explosiom", "ref_value": 89, "order": 3}], "pendencies_resource": [{"id": 33, "action": "view", "begin_date": "2017-03-01T19:06:00Z", "end_date": "2017-03-02T00:06:00Z", "limit_date": "2017-03-02T19:06:00Z"}], "_my_subclass": "goals", "name": "Snuff", "slug": "snuff", "brief_description": "<p>Deserve to have you</p>", "show_window": false, "all_students": true, "visible": true, "order": 19, "create_date": "2017-03-01T19:07:07.980858Z", "last_update": "2017-03-03T01:16:22.746523Z", "presentation": "<p>Resembles rage again...</p>", "limit_submission_date": "2017-03-02T21:05:00Z"}] | |
2 | 1 | \ No newline at end of file |
2 | +[[{"id": 1, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 44, "name": "rvenge"}, {"id": 45, "name": "destruct"}], "pendencies_resource": [{"id": 1, "action": "create", "begin_date": "2017-01-21T23:35:00Z", "end_date": null, "limit_date": null}, {"id": 2, "action": "view", "begin_date": "2017-01-20T23:35:00Z", "end_date": "2017-01-31T23:35:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Revenge", "slug": "revenge", "brief_description": "<p>Here Comes</p>", "show_window": false, "all_students": false, "visible": true, "order": 1, "create_date": "2017-01-20T22:42:16.126657Z", "last_update": "2017-01-30T18:39:30.100600Z", "content": "<p>Listen Dammit</p><p>I do know how to make it better thoug</p>"}, {"id": 14, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 58, "name": "survive"}, {"id": 59, "name": "brave"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Care", "slug": "care", "brief_description": "<p>One last minute</p>", "show_window": true, "all_students": false, "visible": true, "order": 2, "create_date": "2017-01-23T17:59:10.053614Z", "last_update": "2017-01-24T21:53:17.119881Z", "content": "You don't really"}, {"id": 3, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 44, "name": "rvenge"}, {"id": 45, "name": "destruct"}], "pendencies_resource": [{"id": 5, "action": "create", "begin_date": "2017-01-24T23:35:00Z", "end_date": null, "limit_date": null}, {"id": 6, "action": "view", "begin_date": "2017-01-24T23:35:00Z", "end_date": "2017-01-31T23:35:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Teste 2", "slug": "teste-2", "brief_description": "<p>Here Comes</p>", "show_window": true, "all_students": false, "visible": true, "order": 3, "create_date": "2017-01-23T17:17:28.416904Z", "last_update": "2017-01-24T21:53:17.131082Z", "content": "Listen Dammit"}, {"id": 4, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 46, "name": "tears"}, {"id": 47, "name": "rain"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Have", "slug": "have", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 5, "create_date": "2017-01-23T17:31:58.957439Z", "last_update": "2017-01-24T21:53:17.155196Z", "content": "Haven't"}, {"id": 21, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 71, "name": "candle"}, {"id": 72, "name": "mass"}], "pendencies_resource": [{"id": 7, "action": "view", "begin_date": "2017-01-25T04:07:00Z", "end_date": "2017-02-02T04:07:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Each small candle", "slug": "each-small-candle", "brief_description": "<p>Uhuh</p>", "show_window": false, "all_students": false, "visible": true, "order": 6, "create_date": "2017-01-24T03:16:17.180365Z", "last_update": "2017-01-24T21:53:17.164135Z", "content": "<p>Lights a corner of the dark</p>"}, {"id": 5, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 46, "name": "tears"}, {"id": 47, "name": "rain"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Lose you", "slug": "lose-you", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 7, "create_date": "2017-01-23T17:34:29.313661Z", "last_update": "2017-01-24T21:53:17.175261Z", "content": "Haven't <b>you heard <i>about the sirens <u>going down</u></i></b>"}, {"id": 16, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 62, "name": "sing"}, {"id": 63, "name": "loud"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Sing", "slug": "sing", "brief_description": "<p>Talking about</p>", "show_window": false, "all_students": false, "visible": false, "order": 8, "create_date": "2017-01-23T22:10:39.437832Z", "last_update": "2017-01-24T21:53:17.197911Z", "content": "Sing sing"}, {"id": 49, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [{"id": 22, "action": "view", "begin_date": "2017-01-31T19:38:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Testes", "slug": "testes", "brief_description": "<p>asd</p>", "show_window": false, "all_students": false, "visible": true, "order": 9, "create_date": "2017-01-30T18:38:25.741186Z", "last_update": "2017-01-30T18:38:25.878442Z", "content": "<p>COmon</p>"}, {"id": 50, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [{"id": 23, "action": "view", "begin_date": "2017-02-03T19:38:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Yellow", "slug": "yellow", "brief_description": "<p>Vber</p>", "show_window": false, "all_students": false, "visible": true, "order": 10, "create_date": "2017-01-30T18:39:04.914450Z", "last_update": "2017-01-30T18:39:05.212499Z", "content": "<p>Flicker Berat</p>"}, {"id": 58, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 112, "name": "castle"}], "pendencies_resource": [{"id": 27, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Berry the castle", "slug": "berry-the-castle", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 15, "create_date": "2017-02-23T15:22:21.044556Z", "last_update": "2017-02-23T15:22:21.371782Z", "content": "<p>Crush crush crush<br></p>"}, {"id": 59, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 109, "name": "teste"}], "pendencies_resource": [{"id": 28, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "What you get", "slug": "what-you-get", "brief_description": "<p>To me</p>", "show_window": false, "all_students": true, "visible": true, "order": 16, "create_date": "2017-02-23T15:23:56.414396Z", "last_update": "2017-02-23T15:23:56.482582Z", "content": "<p>Let your heart with</p>"}, {"id": 66, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 116, "name": "Lord"}], "pendencies_resource": [{"id": 30, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Last Stand", "slug": "last-stand", "brief_description": "<p>For the grace of the might of the Lord </p>", "show_window": false, "all_students": true, "visible": true, "order": 17, "create_date": "2017-02-24T20:31:26.650857Z", "last_update": "2017-02-24T20:31:26.778340Z", "content": "<p>Twenty Seven</p>"}, {"id": 68, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 118, "name": "calling"}], "pendencies_resource": [{"id": 31, "action": "view", "begin_date": "2017-02-28T23:01:00Z", "end_date": "2017-03-01T23:02:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Angels calling", "slug": "angels-calling", "brief_description": "<p>Falling</p>", "show_window": false, "all_students": true, "visible": true, "order": 18, "create_date": "2017-02-24T20:47:51.687147Z", "last_update": "2017-02-25T01:35:19.427849Z", "content": "<p>Your name</p>"}], [{"id": 51, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 103, "name": "mirror"}, {"id": 104, "name": "to do"}], "pendencies_resource": [{"id": 24, "action": "view", "begin_date": "2017-02-01T21:59:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "ytvideo", "name": "System", "slug": "system", "brief_description": "<p>Gotta</p>", "show_window": true, "all_students": true, "visible": true, "order": 11, "create_date": "2017-02-01T21:03:21.123568Z", "last_update": "2017-02-02T23:08:32.570997Z", "url": "https://www.youtube.com/embed/qOrXWhmUbJ0"}], [{"id": 40, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 91, "name": "end"}, {"id": 92, "name": "tonight"}], "pendencies_resource": [{"id": 21, "action": "view", "begin_date": "2017-01-31T19:33:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "filelink", "name": "Alive", "slug": "alive", "brief_description": "<p>Nothern lights</p><p>I'm still</p>", "show_window": true, "all_students": true, "visible": true, "order": 4, "create_date": "2017-01-24T21:52:58.028122Z", "last_update": "2017-01-30T18:33:25.804307Z", "file_content": "/uploads/files/index.html"}, {"id": 73, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 125, "name": "Zafkiel"}], "pendencies_resource": [], "_my_subclass": "filelink", "name": "Lies", "slug": "lies", "brief_description": "", "show_window": false, "all_students": false, "visible": true, "order": 20, "create_date": "2017-04-26T03:03:38.089353Z", "last_update": "2017-04-26T03:03:38.531148Z", "file_content": "/uploads/files/kurumi.png"}], [{"id": 53, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 106, "name": "otherside"}], "pendencies_resource": [], "_my_subclass": "link", "name": "Sorry", "slug": "sorry", "brief_description": "<p>Hellor</p>", "show_window": false, "all_students": true, "visible": true, "order": 12, "create_date": "2017-02-02T18:59:06.159653Z", "last_update": "2017-02-02T18:59:06.270167Z", "link_url": "https://www.youtube.com/embed/qOrXWhmUbJ0"}, {"id": 57, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 109, "name": "teste"}], "pendencies_resource": [], "_my_subclass": "link", "name": "Unravel", "slug": "unravel", "brief_description": "<p>Co asseru</p>", "show_window": true, "all_students": true, "visible": true, "order": 14, "create_date": "2017-02-12T04:18:39.836818Z", "last_update": "2017-02-12T04:18:40.083226Z", "link_url": "http://stackoverflow.com/questions/813418/django-set-field-value-after-a-form-is-initialized"}], [{"id": 56, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [], "_my_subclass": "pdffile", "name": "Legend", "slug": "legend", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 13, "create_date": "2017-02-09T18:29:12.935873Z", "last_update": "2017-02-09T18:29:13.410469Z", "file": "/uploads/files/egz_Ez4GoPW.pdf"}], [{"id": 70, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 121, "name": "megumin"}, {"id": 122, "name": "kurumin"}], "item_goal": [{"id": 3, "description": "Let me go", "ref_value": 57, "order": 1}, {"id": 4, "description": "Run away", "ref_value": 70, "order": 2}, {"id": 5, "description": "Explosiom", "ref_value": 89, "order": 3}], "pendencies_resource": [{"id": 33, "action": "view", "begin_date": "2017-03-01T19:06:00Z", "end_date": "2017-03-02T00:06:00Z", "limit_date": "2017-03-02T19:06:00Z"}], "_my_subclass": "goals", "name": "Snuff", "slug": "snuff", "brief_description": "<p>Deserve to have you</p>", "show_window": false, "all_students": true, "visible": true, "order": 19, "create_date": "2017-03-01T19:07:07.980858Z", "last_update": "2017-03-03T01:16:22.746523Z", "presentation": "<p>Resembles rage again...</p>", "limit_submission_date": "2017-03-02T21:05:00Z"}]] | |
3 | 3 | \ No newline at end of file | ... | ... |
subjects/views.py
... | ... | @@ -787,6 +787,8 @@ def realize_backup(request, subject): |
787 | 787 | |
788 | 788 | file = open("backup.json", "w") |
789 | 789 | |
790 | + data_list = [] | |
791 | + | |
790 | 792 | if participants: |
791 | 793 | participants = User.objects.filter(subject_student__slug = subject) |
792 | 794 | |
... | ... | @@ -799,7 +801,7 @@ def realize_backup(request, subject): |
799 | 801 | |
800 | 802 | serializer_u = UserSerializer(participants, many = True) |
801 | 803 | |
802 | - json.dump(serializer_u.data, file) | |
804 | + data_list.append(serializer_u.data) | |
803 | 805 | |
804 | 806 | serializer_w = CompleteWebpageSerializer(webpages, many = True) |
805 | 807 | serializer_y = CompleteYTVideoSerializer(ytvideos, many = True) |
... | ... | @@ -815,12 +817,21 @@ def realize_backup(request, subject): |
815 | 817 | serializer_p = SimplePDFFileSerializer(pdffiles, many = True) |
816 | 818 | serializer_g = SimpleGoalSerializer(goals, many = True) |
817 | 819 | |
818 | - json.dump(serializer_w.data, file) | |
819 | - json.dump(serializer_y.data, file) | |
820 | - json.dump(serializer_f.data, file) | |
821 | - json.dump(serializer_l.data, file) | |
822 | - json.dump(serializer_p.data, file) | |
823 | - json.dump(serializer_g.data, file) | |
820 | + | |
821 | + data_list.append(serializer_w.data) | |
822 | + data_list.append(serializer_y.data) | |
823 | + data_list.append(serializer_f.data) | |
824 | + data_list.append(serializer_l.data) | |
825 | + data_list.append(serializer_p.data) | |
826 | + data_list.append(serializer_g.data) | |
827 | + | |
828 | + json.dump(data_list, file) | |
829 | + # json.dump(serializer_w.data, file) | |
830 | + # json.dump(serializer_y.data, file) | |
831 | + # json.dump(serializer_f.data, file) | |
832 | + # json.dump(serializer_l.data, file) | |
833 | + # json.dump(serializer_p.data, file) | |
834 | + # json.dump(serializer_g.data, file) | |
824 | 835 | |
825 | 836 | file.close() |
826 | 837 | |
... | ... | @@ -880,13 +891,30 @@ def realize_restore(request, subject): |
880 | 891 | |
881 | 892 | path = file.extract(json_file, dst_path) |
882 | 893 | |
883 | - for line in open(path, 'r'): | |
884 | - print(line) | |
885 | - #print(json.loads(line)) | |
886 | - | |
887 | - # with open(path) as bkp_file: | |
888 | - # data = json.loads(bkp_file.read()) | |
889 | - | |
890 | - # print(data) | |
894 | + with open(path) as bkp_file: | |
895 | + data = json.loads(bkp_file.read()) | |
896 | + | |
897 | + for line in data: | |
898 | + if "_my_subclass" in line[0]: | |
899 | + print(line) | |
900 | + if line[0]["_my_subclass"] == "webpage": | |
901 | + serial = SimpleWebpageSerializer(data = line, many = True) | |
902 | + elif line[0]["_my_subclass"] == "filelink": | |
903 | + serial = SimpleFileLinkSerializer(data = line, many = True) | |
904 | + elif line[0]["_my_subclass"] == "link": | |
905 | + serial = SimpleLinkSerializer(data = line, many = True) | |
906 | + elif line[0]["_my_subclass"] == "pdffile": | |
907 | + serial = SimplePDFFileSerializer(data = line, many = True) | |
908 | + elif line[0]["_my_subclass"] == "goals": | |
909 | + serial = SimpleGoalSerializer(data = line, many = True) | |
910 | + elif line[0]["_my_subclass"] == "ytvideo": | |
911 | + serial = SimpleYTVideoSerializer(data = line, many = True) | |
912 | + | |
913 | + serial.is_valid() | |
914 | + print(serial.errors) | |
915 | + print("\n\n\n") | |
916 | + # stream = BytesIO(line[0]) | |
917 | + #line_data = JSONParser().parse(line[0]) | |
918 | + # print(line_data) | |
891 | 919 | |
892 | 920 | return JsonResponse({'message': 'ok'}) |
893 | 921 | \ No newline at end of file | ... | ... |