Merge branch 'master' of https://github.com/LQDJudge/online-judge into pagevote
This commit is contained in:
commit
8108967959
5 changed files with 35 additions and 13 deletions
|
@ -109,12 +109,9 @@ class PageVoteDetailView(TemplateResponseMixin, SingleObjectMixin, View):
|
|||
return context
|
||||
|
||||
|
||||
class PageVoteListView(ListView):
|
||||
pagevote_page = None
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(PageVoteListView, self).get_context_data(**kwargs)
|
||||
for item in context["object_list"]:
|
||||
class PageVoteListView:
|
||||
def add_pagevote_context_data(self, context, obj_list="object_list"):
|
||||
for item in context[obj_list]:
|
||||
pagevote, _ = PageVote.objects.get_or_create(
|
||||
page=self.get_comment_page(item)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue