Skip to content

Commit

Permalink
Added game_table2 to tournamet_detail.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhiiva committed Jul 15, 2019
1 parent 1064fa4 commit 4d4a13b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions agagd/agagd_core/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ class GameTable2(tables.Table):
'agagd_core.views.member_detail',
verbose_name="black player",
kwargs={"member_id":tables.A('pin_player_2.member_id')})
tournament_code = tables.LinkColumn(
verbose_name="Tournament",
viewname='agagd_core.views.tournament_detail',
kwargs={'tourn_code':tables.A('tournament_code.tournament_code')},)

class Meta:
model = Game
# add class="paleblue" to <table> tag
Expand Down
8 changes: 4 additions & 4 deletions agagd/agagd_core/views/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from agagd_core.json_response import JsonResponse
from agagd_core.models import Game, Member, Tournament, Chapters, Country
from agagd_core.tables import GameTable, MemberTable, TournamentTable, OpponentTable, TournamentPlayedTable
from agagd_core.tables import GameTable, GameTable2, MemberTable, TournamentTable, OpponentTable, TournamentPlayedTable
from datetime import datetime, timedelta, date
from django.core import exceptions
from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -163,11 +163,11 @@ def member_vs(request, member_id, other_id):

def tournament_detail(request, tourn_code):
tourney = Tournament.objects.get(pk=tourn_code)
game_table = GameTable(tourney.games_in_tourney.all())
RequestConfig(request, paginate={'per_page': 20}).configure(game_table)
game_table2 = GameTable2(tourney.games_in_tourney.all())
RequestConfig(request, paginate={'per_page': 20}).configure(game_table2)
return render(request, 'agagd_core/tourney.html',
{
'game_table': game_table,
'game_table2': game_table2,
'tournament': tourney,
})

Expand Down

0 comments on commit 4d4a13b

Please sign in to comment.