Add news posts
You know. For basic information. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -8,14 +8,14 @@ from django.http import Http404, HttpResponseRedirect
|
||||
from django.http.request import QueryDict
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic import edit
|
||||
from django.views.generic import edit, list
|
||||
from django.urls import reverse, reverse_lazy
|
||||
from django.utils import timezone
|
||||
|
||||
from guardian.shortcuts import get_objects_for_user
|
||||
|
||||
from board.forms import *
|
||||
from board.models import Ban, BanTemplate, Board, Post, Report
|
||||
from board.models import Ban, BanTemplate, Board, NewsPost, Post, Report
|
||||
from board.utils import *
|
||||
|
||||
__all__ = (
|
||||
@@ -23,6 +23,7 @@ __all__ = (
|
||||
"BanSuccessView",
|
||||
"BannedView",
|
||||
"BoardView",
|
||||
"NewsListView",
|
||||
"PostCreateView",
|
||||
"PostModifyView",
|
||||
"PostModifySuccessView",
|
||||
@@ -372,3 +373,9 @@ class BanSuccessView(PermissionRequiredMixin, TemplateView):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["window_timeout"] = settings.BAN_WINDOW_CLOSE_TIMEOUT
|
||||
return context
|
||||
|
||||
|
||||
class NewsListView(list.ListView):
|
||||
model = NewsPost
|
||||
template_name = "board/news_list.html"
|
||||
ordering = ("-created",)
|
||||
|
||||
Reference in New Issue
Block a user