|
|
|
|
@ -61,6 +61,7 @@ class TeamScoreAdmin(admin.ModelAdmin): |
|
|
|
|
list_display = ['team_registration', 'score', 'walk_out', 'match'] |
|
|
|
|
list_filter = [TeamScoreTournamentListFilter] |
|
|
|
|
search_fields = ['id'] |
|
|
|
|
raw_id_fields = ['team_registration', 'match'] # Add this line |
|
|
|
|
list_per_page = 50 # Controls pagination on the list view |
|
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
|
@ -72,17 +73,36 @@ class RoundAdmin(admin.ModelAdmin): |
|
|
|
|
list_filter = [SimpleTournamentListFilter, SimpleIndexListFilter] |
|
|
|
|
search_fields = ['id'] |
|
|
|
|
ordering = ['parent'] |
|
|
|
|
raw_id_fields = ['parent'] # Add this line |
|
|
|
|
list_per_page = 50 # Controls pagination on the list view |
|
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
|
qs = super().get_queryset(request) |
|
|
|
|
return qs.select_related('parent') |
|
|
|
|
|
|
|
|
|
class PlayerRegistrationAdmin(admin.ModelAdmin): |
|
|
|
|
list_display = ['first_name', 'last_name', 'licence_id', 'rank'] |
|
|
|
|
search_fields = ('first_name', 'last_name', 'licence_id__icontains') |
|
|
|
|
list_filter = ['registered_online', TeamScoreTournamentListFilter] |
|
|
|
|
ordering = ['last_name', 'first_name'] |
|
|
|
|
raw_id_fields = ['team_registration'] # Add this line |
|
|
|
|
list_per_page = 50 # Controls pagination on the list view |
|
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
|
qs = super().get_queryset(request) |
|
|
|
|
return qs.select_related('team_registration') |
|
|
|
|
|
|
|
|
|
class MatchAdmin(admin.ModelAdmin): |
|
|
|
|
list_display = ['__str__', 'round', 'group_stage', 'start_date', 'end_date', 'index'] |
|
|
|
|
list_filter = [MatchTypeListFilter, MatchTournamentListFilter, SimpleIndexListFilter] |
|
|
|
|
ordering = ['-group_stage', 'round'] |
|
|
|
|
raw_id_fields = ['round', 'group_stage'] # Add this line |
|
|
|
|
list_per_page = 50 # Controls pagination on the list view |
|
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
|
qs = super().get_queryset(request) |
|
|
|
|
return qs.select_related('round', 'group_stage') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GroupStageAdmin(admin.ModelAdmin): |
|
|
|
|
list_display = ['tournament', 'start_date', 'index'] |
|
|
|
|
|