aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/views/articles.py
blob: cce601e1acff9f01d10befd7cee10cc27ff6c34b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django.core.handlers.wsgi import WSGIRequest
from django.http import HttpResponse
from django.shortcuts import render
from django.views import View

from pydis_site.apps.content.utils import get_articles, get_categories


class ArticlesView(View):
    """Shows all content and categories."""

    def get(self, request: WSGIRequest) -> HttpResponse:
        """Shows all content and categories."""
        return render(
            request,
            "content/articles.html",
            {"content": get_articles(), "categories": get_categories()}
        )