|
|
@@ -40,12 +40,12 @@ LOG = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
def notebooks(request):
|
|
|
- editor_type = request.GET.get('type')
|
|
|
+ editor_type = request.GET.get('type', 'notebook')
|
|
|
|
|
|
- if editor_type:
|
|
|
- notebooks = [d.content_object.to_dict() for d in Document.objects.get_docs(request.user, Document2, qfilter=Q(extra='notebook') | Q(extra__startswith='query')) if not d.content_object.is_history and d.content_object.type == 'query-' + editor_type]
|
|
|
+ if editor_type != 'notebook':
|
|
|
+ notebooks = [d.content_object.to_dict() for d in Document.objects.get_docs(request.user, Document2, qfilter=Q(extra__startswith='query')) if not d.content_object.is_history and d.content_object.type == 'query-' + editor_type]
|
|
|
else:
|
|
|
- notebooks = [d.content_object.to_dict() for d in Document.objects.get_docs(request.user, Document2, qfilter=Q(extra='notebook') | Q(extra__startswith='query')) if not d.content_object.is_history]
|
|
|
+ notebooks = [d.content_object.to_dict() for d in Document.objects.get_docs(request.user, Document2, qfilter=Q(extra='notebook')) if not d.content_object.is_history]
|
|
|
|
|
|
return render('notebooks.mako', request, {
|
|
|
'notebooks_json': json.dumps(notebooks, cls=JSONEncoderForHTML),
|