From 2de204bd1eab660ebf11606b52a031c1c144b9fe Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Sun, 27 Nov 2016 14:59:27 +0530 Subject: [PATCH 1/7] Setup ModelAdmin class for each model in Hosts app --- apps/challenges/admin.py | 27 ++++++++++++++++++++++++++- apps/hosts/admin.py | 18 +++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/apps/challenges/admin.py b/apps/challenges/admin.py index 8c38f3f3da..3813c267a2 100644 --- a/apps/challenges/admin.py +++ b/apps/challenges/admin.py @@ -1,3 +1,28 @@ from django.contrib import admin -# Register your models here. +from base.admin import TimeStampedAdmin + +from .models import Challenge, Phase + + +@admin.register(Challenge) +class ChallengeModelAdmin(TimeStampedAdmin): + list_display = ("title", + "start_date", + "end_date", + "creator", + "published", + "enable_forum", + "anonymous_leaderboard") + list_filter = ("creator", + "published", + "enable_forum", + "anonymous_leaderboard") + search_fields = ("title", "creator") + + +@admin.register(Phase) +class PhaseModelAdmin(TimeStampedAdmin): + list_display = ("name", "leaderboard_public", "challenge") + list_filter = ("leaderboard_public", "challenge") + search_fields = ("name") diff --git a/apps/hosts/admin.py b/apps/hosts/admin.py index 8c38f3f3da..41f7dc3c41 100644 --- a/apps/hosts/admin.py +++ b/apps/hosts/admin.py @@ -1,3 +1,19 @@ from django.contrib import admin -# Register your models here. +from base.admin import TimeStampedAdmin + +from .models import ChallengeHostTeam, ChallengeHost + + +@admin.register(ChallengeHostTeam) +class HostTeamModelAdmin(TimeStampedAdmin): + list_display = ("team_name", "created_by") + list_filter = ("team_name", "created_by") + search_fields = ("team_name", "created_by") + + +@admin.register(ChallengeHost) +class HostModelAdmin(TimeStampedAdmin): + list_display = ("user", "team_name", "status") + list_filter = ("user", "team_name", "status") + search_fields = ("user", "team_name", "status") From b1cbe253275372d69eb5cb9741a8e1e5da130096 Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Sun, 27 Nov 2016 15:01:25 +0530 Subject: [PATCH 2/7] Setup ModelAdmin class for each model in Hosts app --- apps/hosts/admin.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/hosts/admin.py b/apps/hosts/admin.py index 8c38f3f3da..41f7dc3c41 100644 --- a/apps/hosts/admin.py +++ b/apps/hosts/admin.py @@ -1,3 +1,19 @@ from django.contrib import admin -# Register your models here. +from base.admin import TimeStampedAdmin + +from .models import ChallengeHostTeam, ChallengeHost + + +@admin.register(ChallengeHostTeam) +class HostTeamModelAdmin(TimeStampedAdmin): + list_display = ("team_name", "created_by") + list_filter = ("team_name", "created_by") + search_fields = ("team_name", "created_by") + + +@admin.register(ChallengeHost) +class HostModelAdmin(TimeStampedAdmin): + list_display = ("user", "team_name", "status") + list_filter = ("user", "team_name", "status") + search_fields = ("user", "team_name", "status") From d6096725e913911a1cf6843a523c278879568b47 Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Sun, 27 Nov 2016 15:02:18 +0530 Subject: [PATCH 3/7] Setup ModelAdmin class for each model in Hosts app --- apps/challenges/admin.py | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/apps/challenges/admin.py b/apps/challenges/admin.py index 3813c267a2..8c38f3f3da 100644 --- a/apps/challenges/admin.py +++ b/apps/challenges/admin.py @@ -1,28 +1,3 @@ from django.contrib import admin -from base.admin import TimeStampedAdmin - -from .models import Challenge, Phase - - -@admin.register(Challenge) -class ChallengeModelAdmin(TimeStampedAdmin): - list_display = ("title", - "start_date", - "end_date", - "creator", - "published", - "enable_forum", - "anonymous_leaderboard") - list_filter = ("creator", - "published", - "enable_forum", - "anonymous_leaderboard") - search_fields = ("title", "creator") - - -@admin.register(Phase) -class PhaseModelAdmin(TimeStampedAdmin): - list_display = ("name", "leaderboard_public", "challenge") - list_filter = ("leaderboard_public", "challenge") - search_fields = ("name") +# Register your models here. From a9f80121d0e1c5e79127868405b49ef7cb374cdb Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Sun, 27 Nov 2016 16:08:13 +0530 Subject: [PATCH 4/7] Hosts admin --- apps/hosts/admin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/hosts/admin.py b/apps/hosts/admin.py index 41f7dc3c41..c2ce8ebdfd 100644 --- a/apps/hosts/admin.py +++ b/apps/hosts/admin.py @@ -2,17 +2,18 @@ from base.admin import TimeStampedAdmin -from .models import ChallengeHostTeam, ChallengeHost +from .models import (ChallengeHostAdmin, + ChallengeHostTeamAdmin) -@admin.register(ChallengeHostTeam) +@admin.register(ChallengeHostTeamAdmin) class HostTeamModelAdmin(TimeStampedAdmin): list_display = ("team_name", "created_by") list_filter = ("team_name", "created_by") search_fields = ("team_name", "created_by") -@admin.register(ChallengeHost) +@admin.register(ChallengeHostAdmin) class HostModelAdmin(TimeStampedAdmin): list_display = ("user", "team_name", "status") list_filter = ("user", "team_name", "status") From 270704aa6ff02c273ce635219c31594ee41e045f Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Tue, 29 Nov 2016 16:18:45 +0530 Subject: [PATCH 5/7] Hosts admin --- apps/hosts/admin.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/hosts/admin.py b/apps/hosts/admin.py index c2ce8ebdfd..4e508a84e6 100644 --- a/apps/hosts/admin.py +++ b/apps/hosts/admin.py @@ -2,19 +2,19 @@ from base.admin import TimeStampedAdmin -from .models import (ChallengeHostAdmin, - ChallengeHostTeamAdmin) +from .models import (ChallengeHost, + ChallengeHostTeam) -@admin.register(ChallengeHostTeamAdmin) +@admin.register(ChallengeHostTeam) class HostTeamModelAdmin(TimeStampedAdmin): list_display = ("team_name", "created_by") - list_filter = ("team_name", "created_by") + list_filter = ("created_by", ) search_fields = ("team_name", "created_by") -@admin.register(ChallengeHostAdmin) +@admin.register(ChallengeHost) class HostModelAdmin(TimeStampedAdmin): - list_display = ("user", "team_name", "status") - list_filter = ("user", "team_name", "status") - search_fields = ("user", "team_name", "status") + list_display = ("user", "team_name", "status", "permissions") + list_filter = ("status", "permissions") + search_fields = ("user", "team_name") From 0a92a8619163f92d37299d039de6706faa5f6030 Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Sat, 3 Dec 2016 15:36:07 +0530 Subject: [PATCH 6/7] replacing class name --- apps/hosts/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hosts/admin.py b/apps/hosts/admin.py index 4e508a84e6..535d8e289c 100644 --- a/apps/hosts/admin.py +++ b/apps/hosts/admin.py @@ -14,7 +14,7 @@ class HostTeamModelAdmin(TimeStampedAdmin): @admin.register(ChallengeHost) -class HostModelAdmin(TimeStampedAdmin): +class ChallengeHostAdmin(TimeStampedAdmin): list_display = ("user", "team_name", "status", "permissions") list_filter = ("status", "permissions") search_fields = ("user", "team_name") From 7b1bdf4f2bcb3e3a2091a4c7e32b159430fcfddf Mon Sep 17 00:00:00 2001 From: gauthamzz Date: Sat, 3 Dec 2016 15:40:57 +0530 Subject: [PATCH 7/7] fixing class name --- apps/hosts/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hosts/admin.py b/apps/hosts/admin.py index 535d8e289c..97528662b0 100644 --- a/apps/hosts/admin.py +++ b/apps/hosts/admin.py @@ -7,7 +7,7 @@ @admin.register(ChallengeHostTeam) -class HostTeamModelAdmin(TimeStampedAdmin): +class ChallengeHostTeamModelAdmin(TimeStampedAdmin): list_display = ("team_name", "created_by") list_filter = ("created_by", ) search_fields = ("team_name", "created_by")