Skip to content

Admin Panel

This page is Developer Documentation. It documents how the Django Admin is structured, scoped, and maintained.

Purpose

The admin panel is used for:

  • Curating wiki-derived reference data.
  • Inspecting ingest outputs and player state.
  • Maintaining patch boundary markers for chart interpretation.

Access and permissions

  • Access is limited to staff (permission group) or superusers via Django Admin.
  • player group members (default for accounts created via the login page) are restricted from accessing Django Admin.
  • Ownership fields are enforced in admin classes and should never be editable by non-superusers.

Player scoping rules

Two admin modules define a PlayerScopedAdmin base class that enforces per-player querysets and assigns ownership on create. Any new player-owned model registered with Django Admin should inherit from the local PlayerScopedAdmin implementation in its app.

  • gamedata.admin.PlayerScopedAdmin
  • player_state.admin.PlayerScopedAdmin

Reference data management

Reference data is maintained through admin registrations in definitions.admin. These entries are the source of truth for:

  • Card, bot, ultimate weapon, and guardian chip definitions.
  • Parameter definitions and level tables.
  • Patch boundary labels used by chart flags.

When updating reference data, preserve raw values and follow the wiki immutability rules already enforced in the models.

Common admin workflows

Review a player run import

  1. Open Battle reports and confirm the latest parsed_at timestamp.
  2. Open the related Battle report progress row and verify tier, wave, and real_time_seconds.
  3. Run bots, Run guardians, and Run combat/utility ultimate weapons exist for future ingestion but are not populated in production. Use Battle report derived metrics for the current source of bot/guardian/ultimate-weapon-related totals.

Curate wiki-derived reference data

  1. Open Wiki data and locate the relevant canonical_name or entity_id.
  2. Review the linked definition entry (cards, bots, ultimate weapons, guardian chips).
  3. Update parameter definitions or level rows only when the wiki source has been re-imported.

Maintain patch boundary markers

  1. Open Patch boundaries and add or update the boundary_date.
  2. Add an optional label that matches the public patch identifier.
  3. Verify chart flags in the dashboard after changes are saved.

Inspect saved chart snapshots

  1. Open Chart snapshots and filter by player.
  2. Confirm target and name reflect the intended saved view.
  3. Use this table to support bug reports or reproduce chart configurations.

Admin module reference

Definitions

definitions.admin

Admin registrations for definitions models.

BotDefinition

Bases: Model

Definition record for a bot as shown in the in-app library.

__str__()

Return the bot name for display contexts.

BotDefinitionAdmin

Bases: ModelAdmin

Admin configuration for BotDefinition.

BotParameterDefinition

Bases: Model

Parameter definition for a bot upgrade parameter.

__str__()

Return a concise string for admin/debug usage.

BotParameterDefinitionAdmin

Bases: ModelAdmin

Admin configuration for BotParameterDefinition.

BotParameterLevel

Bases: Model

Wiki-derived level row for a bot parameter.

__str__()

Return a concise string for admin/debug usage.

BotParameterLevelAdmin

Bases: ModelAdmin

Admin configuration for BotParameterLevel.

CardDefinition

Bases: Model

Definition record for a card as shown in the in-app library.

__str__()

Return the card name for display contexts.

CardDefinitionAdmin

Bases: ModelAdmin

Admin configuration for CardDefinition.

GuardianChipDefinition

Bases: Model

Definition record for guardian chips.

__str__()

Return the chip name for display contexts.

GuardianChipDefinitionAdmin

Bases: ModelAdmin

Admin configuration for GuardianChipDefinition.

GuardianChipParameterDefinition

Bases: Model

Parameter definition for a guardian chip upgrade parameter.

__str__()

Return a concise string for admin/debug usage.

GuardianChipParameterDefinitionAdmin

Bases: ModelAdmin

Admin configuration for GuardianChipParameterDefinition.

GuardianChipParameterLevel

Bases: Model

Wiki-derived level row for a guardian chip parameter.

__str__()

Return a concise string for admin/debug usage.

GuardianChipParameterLevelAdmin

Bases: ModelAdmin

Admin configuration for GuardianChipParameterLevel.

PatchBoundary

Bases: Model

A known game patch boundary used for chart interpretation.

Patch boundaries are advisory signals. They do not change values and should not be used for recommendations.

__str__()

Return a concise display string.

PatchBoundaryAdmin

Bases: ModelAdmin

Admin configuration for PatchBoundary.

UltimateWeaponDefinition

Bases: Model

Definition record for ultimate weapons.

__str__()

Return the weapon name for display contexts.

UltimateWeaponDefinitionAdmin

Bases: ModelAdmin

Admin configuration for UltimateWeaponDefinition.

UltimateWeaponParameterDefinition

Bases: Model

Parameter definition for an ultimate weapon upgrade parameter.

__str__()

Return a concise string for admin/debug usage.

UltimateWeaponParameterDefinitionAdmin

Bases: ModelAdmin

Admin configuration for UltimateWeaponParameterDefinition.

UltimateWeaponParameterLevel

Bases: Model

Wiki-derived level row for an ultimate weapon parameter.

__str__()

Return a concise string for admin/debug usage.

UltimateWeaponParameterLevelAdmin

Bases: ModelAdmin

Admin configuration for UltimateWeaponParameterLevel.

Unit

Bases: Model

A lightweight unit/metadata model for labeling raw parameter values.

Kind

Bases: TextChoices

Broad unit categories for UI display.

__str__()

Return the unit name for display contexts.

UnitAdmin

Bases: ModelAdmin

Admin configuration for Unit.

WikiData

Bases: Model

Versioned, non-destructive store for wiki-derived table data.

Wiki-derived data is ingested as raw strings to provide stable inputs for later analysis phases. Content fields (name, raw_row, hashes, metadata) are treated as immutable once written. Lifecycle fields (last_seen, deprecated) may be updated to support change detection and safe diffing.

__str__()

Return a concise display string for admin/debug usage.

save(*args, **kwargs)

Save the record, enforcing immutability for content fields.

WikiDataAdmin

Bases: ModelAdmin

Admin configuration for WikiData.

Game data

gamedata.admin

Admin registrations for GameData models.

BattleReport

Bases: Model

Raw, preserved battle report payload imported from the player.

__str__()

Return a concise display string for admin/debug usage.

BattleReportAdmin

Bases: PlayerScopedAdmin

Admin configuration for BattleReport.

BattleReportDerivedMetrics

Bases: Model

Persisted derived metrics parsed from Battle Report raw text.

__str__()

Return a concise display string for admin/debug usage.

clean()

Enforce that derived metrics remain scoped to a single player.

save(*args, **kwargs)

Persist derived metrics after validating ownership.

BattleReportDerivedMetricsAdmin

Bases: PlayerScopedAdmin

Admin configuration for BattleReportDerivedMetrics.

BattleReportProgress

Bases: Model

Minimal run metadata extracted from a Battle Report.

This replaces the prior Phase 1 RunProgress but keeps the relationship name run_progress for compatibility with analysis/visualization code.

coins property

Return coins earned for analysis-engine compatibility.

__str__()

Return a concise display string for admin/debug usage.

clean()

Validate that progress metadata stays within a single owning player.

save(*args, **kwargs)

Save while enforcing ownership invariants.

BattleReportProgressAdmin

Bases: PlayerScopedAdmin

Admin configuration for BattleReportProgress.

formfield_for_foreignkey(db_field, request, **kwargs)

Scope preset choices to the authenticated user's Player.

PlayerScopedAdmin

Bases: ModelAdmin

ModelAdmin that enforces per-player queryset filtering and ownership on create.

get_queryset(request)

Return a queryset scoped to the authenticated user's Player.

get_readonly_fields(request, obj=None)

Prevent non-superusers from reassigning ownership fields.

save_model(request, obj, form, change)

Assign player ownership automatically for non-superusers.

RunBot

Bases: Model

Observed bot usage/performance row for a battle report.

clean()

Validate that the run row stays within a single owning player.

save(*args, **kwargs)

Save while enforcing ownership invariants.

RunBotAdmin

Bases: PlayerScopedAdmin

Admin configuration for RunBot.

RunCombatUltimateWeapon

Bases: Model

Observed combat-utility ultimate weapon usage row for a battle report.

clean()

Validate that the run row stays within a single owning player.

save(*args, **kwargs)

Save while enforcing ownership invariants.

RunCombatUltimateWeaponAdmin

Bases: PlayerScopedAdmin

Admin configuration for RunCombatUltimateWeapon.

RunGuardian

Bases: Model

Observed guardian chip usage/performance row for a battle report.

clean()

Validate that the run row stays within a single owning player.

save(*args, **kwargs)

Save while enforcing ownership invariants.

RunGuardianAdmin

Bases: PlayerScopedAdmin

Admin configuration for RunGuardian.

RunUtilityUltimateWeapon

Bases: Model

Observed non-combat ultimate weapon usage row for a battle report.

clean()

Validate that the run row stays within a single owning player.

save(*args, **kwargs)

Save while enforcing ownership invariants.

RunUtilityUltimateWeaponAdmin

Bases: PlayerScopedAdmin

Admin configuration for RunUtilityUltimateWeapon.

Player state

player_state.admin

Admin registrations for player state models.

BattleHistoryColumnPreference

Bases: Model

Persisted Battle History column visibility preferences per player.

__str__()

Return a concise display string for admin contexts.

BattleHistoryColumnPreferenceAdmin

Bases: PlayerScopedAdmin

Admin configuration for BattleHistoryColumnPreference.

ChartSnapshot

Bases: Model

An immutable snapshot used as a reusable comparison anchor.

A snapshot stores: - a constrained Chart Builder configuration (schema-driven), - the context filters used when it was created.

Snapshots are labels over existing metrics and are not a source of new math.

__str__()

Return a concise display string.

save(*args, **kwargs)

Save a snapshot, enforcing immutability after creation.

Raises:

Type Description
ValidationError

When attempting to update an existing snapshot.

ChartSnapshotAdmin

Bases: PlayerScopedAdmin

Admin configuration for ChartSnapshot.

ExploreQuery

Bases: Model

Player-authored Explore query stored as a versioned schema.

__str__()

Return a concise display string for admin contexts.

ExploreQueryAdmin

Bases: PlayerScopedAdmin

Admin configuration for ExploreQuery.

ExploreQueryTemplate

Bases: Model

Admin-managed read-only Explore template shown to all players.

tag_list property

Return normalized tags for template display usage.

__str__()

Return a concise display string for admin contexts.

clean()

Validate template DSL against Explore parsing and schema rules.

save(*args, **kwargs)

Persist the template after validation.

ExploreQueryTemplateAdmin

Bases: ModelAdmin

Admin configuration for ExploreQueryTemplate.

Player

Bases: Model

Root ownership entity for all player-scoped progress.

A Player is a 1:1 extension of the authenticated Django user account.

__str__()

Return the player display name for display contexts.

PlayerAdmin

Bases: ModelAdmin

Admin configuration for Player.

get_queryset(request)

Return a queryset scoped to the authenticated user's Player.

get_readonly_fields(request, obj=None)

Prevent non-superusers from editing identity fields.

save_model(request, obj, form, change)

Assign user ownership automatically for non-superusers.

user_last_login(obj)

Return the related user's last login timestamp.

PlayerBot

Bases: Model

Player bot unlock state (per-parameter progression lives separately).

__str__()

Return a concise display string.

clean()

Validate invariants for bot state.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerBotAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerBot.

PlayerBotParameter

Bases: Model

Player-selected level for a bot parameter definition.

clean()

Validate locked-state and definition alignment.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerBotParameterAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerBotParameter.

PlayerBotRespecWindow

Bases: Model

Track whether a player has used Bot Respec in a specific Event window.

__str__()

Return a concise display string for admin contexts.

PlayerBotRespecWindowAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerBotRespecWindow.

PlayerCard

Bases: Model

Player card unlock state.

Cards are descriptive modifiers and do not use ParameterKey or upgrade tables.

__str__()

Return a concise display string.

clean()

Validate invariants for card state.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerCardAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerCard.

PlayerGuardianChip

Bases: Model

Player guardian chip unlock state (per-parameter progression lives separately).

__str__()

Return a concise display string.

clean()

Validate invariants for guardian chip state.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerGuardianChipAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerGuardianChip.

PlayerGuardianChipParameter

Bases: Model

Player-selected level for a guardian chip parameter definition.

clean()

Validate locked-state and definition alignment.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerGuardianChipParameterAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerGuardianChipParameter.

PlayerScopedAdmin

Bases: ModelAdmin

ModelAdmin that enforces per-player queryset filtering and ownership on create.

get_queryset(request)

Return a queryset scoped to the authenticated user's Player.

get_readonly_fields(request, obj=None)

Prevent non-superusers from reassigning ownership fields.

save_model(request, obj, form, change)

Assign player ownership automatically for non-superusers.

PlayerUltimateWeapon

Bases: Model

Player ultimate weapon unlock state (per-parameter progression lives separately).

__str__()

Return a concise display string.

clean()

Validate invariants for ultimate weapon state.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerUltimateWeaponAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerUltimateWeapon.

PlayerUltimateWeaponParameter

Bases: Model

Player-selected level for an ultimate weapon parameter definition.

clean()

Validate locked-state and definition alignment.

save(*args, **kwargs)

Save while enforcing invariants.

PlayerUltimateWeaponParameterAdmin

Bases: PlayerScopedAdmin

Admin configuration for PlayerUltimateWeaponParameter.

Preset

Bases: Model

A configuration snapshot label (no metrics).

__str__()

Return preset display name.

badge_color()

Return the effective color key for UI badges.

Returns:

Type Description
str

A palette key for use in CSS class names.

save(*args, **kwargs)

Save while ensuring the preset has a stable badge color.

PresetAdmin

Bases: PlayerScopedAdmin

Admin configuration for Preset.