Migrate pagevote and bookmark to use content_type

This commit is contained in:
cuom1999 2023-08-03 16:04:39 +07:00
parent 64495be799
commit 36e27321f7
19 changed files with 285 additions and 87 deletions

View file

@ -224,9 +224,6 @@ class ProblemSolution(
context["has_solved_problem"] = self.problem.id in self.get_completed_problems()
return context
def get_comment_page(self):
return "s:" + self.problem.code
class ProblemRaw(
ProblemMixin, TitleMixin, TemplateResponseMixin, SingleObjectMixin, View
@ -270,9 +267,6 @@ class ProblemDetail(
context_object_name = "problem"
template_name = "problem/problem.html"
def get_comment_page(self):
return "p:%s" % self.object.code
def get_context_data(self, **kwargs):
context = super(ProblemDetail, self).get_context_data(**kwargs)
user = self.request.user
@ -843,9 +837,6 @@ class ProblemFeed(ProblemList, FeedView):
title = _("Problem feed")
feed_type = None
def get_comment_page(self, problem):
return "p:%s" % problem.code
# arr = [[], [], ..]
def merge_recommendation(self, arr):
seed = datetime.now().strftime("%d%m%Y")