summaryrefslogtreecommitdiff
path: root/app/figments/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2015-11-11 21:54:21 -0500
committerluxagraf <sng@luxagraf.net>2015-11-11 21:54:21 -0500
commit92abffcc98404825324341d5ee654642364890bb (patch)
treeaa39b2c4d85e89b452c8c72aef9803da1adeac9c /app/figments/views.py
parentb588a5587c1f9a809509b77b11f4827c6c28f951 (diff)
redo figments to work with CBV, new builder, etc. Also broke out admin
textfield widget to utils
Diffstat (limited to 'app/figments/views.py')
-rw-r--r--app/figments/views.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/app/figments/views.py b/app/figments/views.py
new file mode 100644
index 0000000..6521c29
--- /dev/null
+++ b/app/figments/views.py
@@ -0,0 +1,42 @@
+from django.views.generic import ListView, DetailView
+from django.contrib.syndication.views import Feed
+
+from .models import Figment, Series
+
+
+class FigmentListView(ListView):
+ model = Figment
+ template_name = "archives/figments.html"
+ context_object_name = 'object_list'
+
+ def get_queryset(self):
+ return Figment.objects.filter(status__exact=1).order_by('-pub_date')
+
+
+class SeriesListView(ListView):
+ model = Series
+ template_name = "archives/figments_series.html"
+ context_object_name = 'object_list'
+
+
+class FigmentDetailView(DetailView):
+ model = Figment
+ template_name = "details/figments.html"
+
+
+class FigmentDetailViewTXT(FigmentDetailView):
+ template_name = "details/entry.txt"
+
+
+class FigmentDetailViewAMP(FigmentDetailView):
+ template_name = "details/entry.amp"
+
+
+class FigRSSFeedView(Feed):
+ title = "luxagraf figments: stories less literally true."
+ link = "/figments/"
+ description = "Latest postings to luxagraf.net/figments"
+ description_template = 'feeds/blog_description.html'
+
+ def items(self):
+ return Figment.objects.filter(status__exact=1).order_by('-pub_date')[:10]