feat: add error message page; improve admin ui; add missing test files
This commit is contained in:
		@ -3,7 +3,7 @@ from django.urls import include, path, reverse
 | 
			
		||||
from django.utils.translation import gettext_lazy as _
 | 
			
		||||
from rest_framework.routers import DefaultRouter
 | 
			
		||||
 | 
			
		||||
from .models import Comment, Diffusion, Program
 | 
			
		||||
from . import models
 | 
			
		||||
from .views.admin import StatisticsView
 | 
			
		||||
 | 
			
		||||
__all__ = ["AdminSite"]
 | 
			
		||||
@ -26,17 +26,20 @@ class AdminSite(admin.AdminSite):
 | 
			
		||||
        context.update(
 | 
			
		||||
            {
 | 
			
		||||
                # all programs
 | 
			
		||||
                "programs": Program.objects.active()
 | 
			
		||||
                "programs": models.Program.objects.active()
 | 
			
		||||
                .values("pk", "title")
 | 
			
		||||
                .order_by("title"),
 | 
			
		||||
                # today's diffusions
 | 
			
		||||
                "diffusions": Diffusion.objects.date()
 | 
			
		||||
                "diffusions": models.Diffusion.objects.date()
 | 
			
		||||
                .order_by("start")
 | 
			
		||||
                .select_related("episode"),
 | 
			
		||||
                # TODO: only for dashboard
 | 
			
		||||
                # last comments
 | 
			
		||||
                "comments": Comment.objects.order_by("-date").select_related(
 | 
			
		||||
                    "page"
 | 
			
		||||
                "comments": models.Comment.objects.order_by(
 | 
			
		||||
                    "-date"
 | 
			
		||||
                ).select_related("page")[0:10],
 | 
			
		||||
                "latests": models.Page.objects.select_subclasses().order_by(
 | 
			
		||||
                    "-pub_date"
 | 
			
		||||
                )[0:10],
 | 
			
		||||
            }
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user