Commit 6b8c1f46627e189b1c099e02353df55a15a1981f
1 parent
95dd7630
Exists in
master
and in
2 other branches
Subject restore: start handling data conflicts
Showing
6 changed files
with
58 additions
and
15 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": [], "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": [], "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 | ... | ... |
file_link/serializers.py
... | ... | @@ -8,13 +8,26 @@ from students_group.serializers import StudentsGroupSerializer |
8 | 8 | from .models import FileLink |
9 | 9 | |
10 | 10 | class SimpleFileLinkSerializer(serializers.ModelSerializer): |
11 | - topic = TopicSerializer() | |
11 | + topic = TopicSerializer('get_subject') | |
12 | 12 | tags = TagSerializer(many = True) |
13 | 13 | pendencies_resource = PendenciesSerializer(many = True) |
14 | + file_content = serializers.CharField(required = False, allow_blank = True) | |
15 | + | |
16 | + def get_subject(self, obj): | |
17 | + subject = self.context.get("subject", None) | |
18 | + | |
19 | + return subject | |
14 | 20 | |
15 | 21 | class Meta: |
16 | 22 | model = FileLink |
23 | + extra_kwargs = { | |
24 | + "file_content": { | |
25 | + "required": False, | |
26 | + "validators": [], | |
27 | + }, | |
28 | + } | |
17 | 29 | exclude = ('students', 'groups',) |
30 | + validators = [] | |
18 | 31 | |
19 | 32 | class CompleteFileLinkSerializer(serializers.ModelSerializer): |
20 | 33 | topic = TopicSerializer() | ... | ... |
pdf_file/serializers.py
... | ... | @@ -11,6 +11,12 @@ class SimplePDFFileSerializer(serializers.ModelSerializer): |
11 | 11 | topic = TopicSerializer() |
12 | 12 | tags = TagSerializer(many = True) |
13 | 13 | pendencies_resource = PendenciesSerializer(many = True) |
14 | + file = serializers.CharField(required = False, allow_blank = True) | |
15 | + | |
16 | + def validate(self, data): | |
17 | + print(self.context) | |
18 | + | |
19 | + return data | |
14 | 20 | |
15 | 21 | class Meta: |
16 | 22 | model = PDFFile | ... | ... |
subjects/serializers.py
... | ... | @@ -3,6 +3,22 @@ from rest_framework import serializers |
3 | 3 | from .models import Tag |
4 | 4 | |
5 | 5 | class TagSerializer(serializers.ModelSerializer): |
6 | + def validate(self, data): | |
7 | + query = Tag.objects.filter(name = data['name']) | |
8 | + | |
9 | + if query.exists(): | |
10 | + data['id'] = query[0].id | |
11 | + else: | |
12 | + data['id'] = "" | |
13 | + | |
14 | + return data | |
15 | + | |
6 | 16 | class Meta: |
7 | 17 | model = Tag |
8 | - fields = '__all__' | |
9 | 18 | \ No newline at end of file |
19 | + fields = '__all__' | |
20 | + extra_kwargs = { | |
21 | + "name": { | |
22 | + "validators": [], | |
23 | + }, | |
24 | + } | |
25 | + validators = [] | |
10 | 26 | \ No newline at end of file | ... | ... |
subjects/views.py
... | ... | @@ -878,6 +878,7 @@ class Restore(LoginRequiredMixin, TemplateView): |
878 | 878 | |
879 | 879 | @login_required |
880 | 880 | def realize_restore(request, subject): |
881 | + subjetc = get_object_or_404(Subject, slug = subject) | |
881 | 882 | zip_file = request.FILES.get('zip_file', None) |
882 | 883 | |
883 | 884 | if zip_file: |
... | ... | @@ -896,25 +897,23 @@ def realize_restore(request, subject): |
896 | 897 | |
897 | 898 | for line in data: |
898 | 899 | if "_my_subclass" in line[0]: |
899 | - print(line) | |
900 | 900 | if line[0]["_my_subclass"] == "webpage": |
901 | - serial = SimpleWebpageSerializer(data = line, many = True) | |
901 | + serial = SimpleWebpageSerializer(data = line, many = True, context = {'subject': subject}) | |
902 | 902 | elif line[0]["_my_subclass"] == "filelink": |
903 | - serial = SimpleFileLinkSerializer(data = line, many = True) | |
903 | + serial = SimpleFileLinkSerializer(data = line, many = True, context = {'subject': subject}) | |
904 | 904 | elif line[0]["_my_subclass"] == "link": |
905 | - serial = SimpleLinkSerializer(data = line, many = True) | |
905 | + serial = SimpleLinkSerializer(data = line, many = True, context = {'subject': subject}) | |
906 | 906 | elif line[0]["_my_subclass"] == "pdffile": |
907 | - serial = SimplePDFFileSerializer(data = line, many = True) | |
907 | + serial = SimplePDFFileSerializer(data = line, many = True, context = {'subject': subject}) | |
908 | 908 | elif line[0]["_my_subclass"] == "goals": |
909 | - serial = SimpleGoalSerializer(data = line, many = True) | |
909 | + serial = SimpleGoalSerializer(data = line, many = True, context = {'subject': subject}) | |
910 | 910 | elif line[0]["_my_subclass"] == "ytvideo": |
911 | - serial = SimpleYTVideoSerializer(data = line, many = True) | |
911 | + serial = SimpleYTVideoSerializer(data = line, many = True, context = {'subject': subject}) | |
912 | 912 | |
913 | 913 | serial.is_valid() |
914 | 914 | print(serial.errors) |
915 | + print("\n") | |
916 | + print(serial.validated_data) | |
915 | 917 | print("\n\n\n") |
916 | - # stream = BytesIO(line[0]) | |
917 | - #line_data = JSONParser().parse(line[0]) | |
918 | - # print(line_data) | |
919 | 918 | |
920 | 919 | return JsonResponse({'message': 'ok'}) |
921 | 920 | \ No newline at end of file | ... | ... |
topics/serializers.py
1 | 1 | from rest_framework import serializers |
2 | 2 | |
3 | -from .models import Topic, Resource | |
3 | +from .models import Topic | |
4 | 4 | |
5 | 5 | class TopicSerializer(serializers.ModelSerializer): |
6 | + def validate(self, data): | |
7 | + subject = self.context.get('subject', None) | |
8 | + | |
9 | + if subject: | |
10 | + print(subject) | |
11 | + | |
12 | + return data | |
13 | + | |
6 | 14 | class Meta: |
7 | 15 | model = Topic |
8 | - exclude = ('subject',) | |
9 | 16 | \ No newline at end of file |
17 | + exclude = ('subject',) | |
18 | + | ... | ... |