summaryrefslogtreecommitdiff
path: root/app/unused_apps/people/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-11-11 21:49:34 -0500
committerluxagraf <sng@luxagraf.net>2020-11-11 21:49:34 -0500
commit199184b3b680bc4c8878bf11a60c0fbf72fb612f (patch)
tree92195ea8a1ba5e61fefca51896c2b8e01cdeaf43 /app/unused_apps/people/views.py
parent129a8545b520380a8567a4e7405634250f3d7da5 (diff)
removed some things I wasn't using to clean up code base
Diffstat (limited to 'app/unused_apps/people/views.py')
-rw-r--r--app/unused_apps/people/views.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/app/unused_apps/people/views.py b/app/unused_apps/people/views.py
new file mode 100644
index 0000000..36c0657
--- /dev/null
+++ b/app/unused_apps/people/views.py
@@ -0,0 +1,38 @@
+from django.views.generic.detail import DetailView
+from utils.views import PaginatedListView
+
+from taggit.models import Tag
+from .models import Person
+
+
+class PersonListView(PaginatedListView):
+ model = Person
+ template_name = 'archives/people.html'
+
+ def get_context_data(self, **kwargs):
+ # Call the base implementation first to get a context
+ context = super(PersonListView, self).get_context_data(**kwargs)
+ context['tags'] = Person.tags.all()
+ return context
+
+
+class PersonDetailView(DetailView):
+ model = Person
+ template_name = "details/person.html"
+ slug_field = "slug"
+
+
+class PersonTagListView(PaginatedListView):
+ model = Person
+ template_name = 'archives/people.html'
+
+ def get_queryset(self):
+ print(self.kwargs['slug'])
+ return Person.objects.filter(tags__slug=self.kwargs['slug'])
+
+ def get_context_data(self, **kwargs):
+ # Call the base implementation first to get a context
+ context = super(PersonTagListView, self).get_context_data(**kwargs)
+ context['tag'] = Tag.objects.get(slug__exact=self.kwargs['slug'])
+ context['tags'] = Person.tags.all()
+ return context