class GameReplayAdmin(admin.ModelAdmin): actions = (set_user, queue_for_reprocessing) list_display = ( "__str__", urlify("user"), urlify("global_game"), "visibility", "build", "client_handle", "views", "replay_xml", ) list_filter = ("global_game__game_type", "hsreplay_version", "visibility", "won", "spectator_mode", "disconnected", "reconnecting", "is_deleted") raw_id_fields = ( "upload_token", "user", "global_game", ) readonly_fields = ("shortid", ) search_fields = ("shortid", "global_game__players__name", "user__username") inlines = (UploadEventInline, ) def get_queryset(self, request): qs = super().get_queryset(request) return qs.prefetch_related("global_game__players")
class UploadEventAdmin(admin.ModelAdmin): actions = (queue_for_reprocessing, ) date_hierarchy = "created" list_display = ( "__str__", "status", "tainted", "type", urlify("token"), urlify("game"), "upload_ip", "created", "file", ) list_filter = ("type", "status", "tainted") raw_id_fields = ("token", "game") readonly_fields = ("created", ) search_fields = ("shortid", )
class UploadEventAdmin(admin.ModelAdmin): actions = (queue_for_reprocessing, ) list_display = ("__str__", "status", "tainted", urlify("token"), urlify("game"), "upload_ip", "created", "file", "user_agent") list_filter = ("status", "tainted", "canary") raw_id_fields = ("token", "game") readonly_fields = ("created", "cloudwatch_url") search_fields = ("shortid", ) show_full_result_count = False def get_queryset(self, request): qs = super().get_queryset(request) return qs.prefetch_related("game__global_game__players")
class PackAdmin(admin.ModelAdmin): date_hierarchy = "date" list_display = ("__str__", "booster_type", "date", urlify("user")) list_filter = ("booster_type", ) raw_id_fields = ("user", ) search_fields = ("cards__name", "user__username") inlines = (PackCardInline, )
class GlobalGamePlayerAdmin(admin.ModelAdmin): actions = (set_user, ) list_display = ("__str__", "account_lo", urlify("hero"), "is_first", "rank", "stars", "legend_rank", "final_state") list_filter = ("rank", "is_ai", "is_first", "hero_premium", "final_state", "player_id") raw_id_fields = ("game", "hero", "user", "deck_list") search_fields = ("name", "real_name")
class AuthTokenAdmin(admin.ModelAdmin): actions = (set_user, ) date_hierarchy = "created" list_display = ("__str__", "user", "created", urlify("creation_apikey"), "test_data") list_filter = ("test_data", ) raw_id_fields = ("user", ) search_fields = ("key", "user__username") inlines = (UploadEventInline, )
class PegasusAccountAdmin(admin.ModelAdmin): list_display = ("__str__", urlify("user"), "account_lo", "account_hi", "region", "created", "modified") list_filter = ("region", ) raw_id_fields = ("user", ) search_fields = ("battletag", ) readonly_fields = ("created", "modified") show_full_result_count = False paginator = EstimatedCountPaginator
class AuthTokenAdmin(admin.ModelAdmin): actions = (set_user, ) date_hierarchy = "created" list_display = ("__str__", "user", "created", urlify("creation_apikey"), "test_data") list_filter = ("test_data", ) raw_id_fields = ("user", ) search_fields = ("key", "user__username") show_full_result_count = False paginator = EstimatedCountPaginator
class GlobalGamePlayerAdmin(admin.ModelAdmin): actions = (set_user, ) list_display = ("__str__", "account_lo", urlify("hero"), "is_first", "rank", "stars", "legend_rank", "final_state") list_filter = ("is_ai", "is_first", "hero_premium", "final_state", "player_id") raw_id_fields = ("game", "hero", "deck_list", "pegasus_account") search_fields = ("name", ) show_full_result_count = False paginator = EstimatedCountPaginator
class GameReplayAdmin(admin.ModelAdmin): actions = (set_user, ) list_display = ( "__str__", urlify("user"), urlify("global_game"), "hsreplay_version", "replay_xml", ) list_filter = ( "hsreplay_version", "is_spectated_game", "won", "disconnected", "is_deleted", ) raw_id_fields = ( "upload_token", "user", "global_game", ) inlines = (UploadEventInline, PendingReplayOwnershipInline)
class GameReplayAdmin(admin.ModelAdmin): actions = (set_user, queue_for_reprocessing) list_display = ("__str__", urlify("user"), urlify("global_game"), "visibility", "build", "client_handle", "views", "replay_xml", "upload_event") list_filter = ("visibility", "won", "spectator_mode", "disconnected", "reconnecting", "is_deleted") raw_id_fields = ("upload_token", "user", "global_game") readonly_fields = ("shortid", "upload_event", "opponent_revealed_deck") search_fields = ("shortid", "global_game__players__name", "user__username") show_full_result_count = False paginator = EstimatedCountPaginator def get_queryset(self, request): qs = super().get_queryset(request) return qs.prefetch_related("global_game__players") def upload_event(self, obj): return '<a href="%s">%s</a>' % (obj.upload_event_admin_url, obj.shortid) upload_event.allow_tags = True upload_event.short_description = "Upload Event"
class AccountClaimAdmin(admin.ModelAdmin): list_display = ("__str__", "created", urlify("token"), urlify("api_key")) list_filter = ("api_key", ) raw_id_fields = ("token", ) readonly_fields = ("created", )
class GlobalGamePlayerAdmin(admin.ModelAdmin): actions = (set_user, ) list_display = ("__str__", urlify("user"), "player_id", "is_first") list_filter = ("is_ai", "rank", "is_first") raw_id_fields = ("game", "user", "deck_list")