from django.shortcuts import render, get_object_or_404 from .models import MindMap def mindmap_list(request): mindmaps = MindMap.objects.filter(mindmap_data__isnull=False).exclude( mindmap_data={} ) return render(request, "mindlist.html", {"mindmaps": mindmaps}) def mindmap_detail(request, slug): mm = get_object_or_404(MindMap, slug=slug) return render(request, "minddetail.html", {"mindmap": mm})