|
@@ -202,12 +202,13 @@ def save_notebook(request):
|
|
|
response = {'status': -1}
|
|
response = {'status': -1}
|
|
|
|
|
|
|
|
notebook = json.loads(request.POST.get('notebook', '{}'))
|
|
notebook = json.loads(request.POST.get('notebook', '{}'))
|
|
|
|
|
+ notebook_type = notebook.get('type', 'notebook')
|
|
|
|
|
|
|
|
if notebook.get('id'):
|
|
if notebook.get('id'):
|
|
|
notebook_doc = Document2.objects.get(id=notebook['id'])
|
|
notebook_doc = Document2.objects.get(id=notebook['id'])
|
|
|
else:
|
|
else:
|
|
|
- notebook_doc = Document2.objects.create(name=notebook['name'], type='notebook', owner=request.user)
|
|
|
|
|
- Document.objects.link(notebook_doc, owner=notebook_doc.owner, name=notebook_doc.name, description=notebook_doc.description, extra='notebook')
|
|
|
|
|
|
|
+ notebook_doc = Document2.objects.create(name=notebook['name'], type=notebook_type, owner=request.user)
|
|
|
|
|
+ Document.objects.link(notebook_doc, owner=notebook_doc.owner, name=notebook_doc.name, description=notebook_doc.description, extra=notebook_type)
|
|
|
|
|
|
|
|
notebook_doc1 = notebook_doc.doc.get()
|
|
notebook_doc1 = notebook_doc.doc.get()
|
|
|
notebook_doc.update_data(notebook)
|
|
notebook_doc.update_data(notebook)
|