Browsing and showing comment documents
[edumed.git] / comment / views.py
diff --git a/comment/views.py b/comment/views.py
new file mode 100644 (file)
index 0000000..748f9c4
--- /dev/null
@@ -0,0 +1,17 @@
+from django.views.generic import ListView, DetailView
+from django.conf import settings
+
+from .models import CommentDocument
+
+
+class CommentDocumentList(ListView):
+    model = CommentDocument
+
+
+class CommentDocument(DetailView):
+    model = CommentDocument
+
+    def get_context_data(self, **kwargs):
+        context = super(CommentDocument, self).get_context_data(**kwargs)
+        context['comment_url'] = settings.COMMENT_URL
+        return context
\ No newline at end of file