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. playergroup 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.PlayerScopedAdminplayer_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¶
- Open
Battle reportsand confirm the latestparsed_attimestamp. - Open the related
Battle report progressrow and verifytier,wave, andreal_time_seconds. Run bots,Run guardians, andRun combat/utility ultimate weaponsexist for future ingestion but are not populated in production. UseBattle report derived metricsfor the current source of bot/guardian/ultimate-weapon-related totals.
Curate wiki-derived reference data¶
- Open
Wiki dataand locate the relevantcanonical_nameorentity_id. - Review the linked definition entry (cards, bots, ultimate weapons, guardian chips).
- Update parameter definitions or level rows only when the wiki source has been re-imported.
Maintain patch boundary markers¶
- Open
Patch boundariesand add or update theboundary_date. - Add an optional label that matches the public patch identifier.
- Verify chart flags in the dashboard after changes are saved.
Inspect saved chart snapshots¶
- Open
Chart snapshotsand filter byplayer. - Confirm
targetandnamereflect the intended saved view. - 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
¶
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.
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
¶
BattleReportDerivedMetrics
¶
BattleReportDerivedMetricsAdmin
¶
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.
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.
RunBot
¶
RunBotAdmin
¶
RunCombatUltimateWeapon
¶
RunCombatUltimateWeaponAdmin
¶
RunGuardian
¶
RunGuardianAdmin
¶
RunUtilityUltimateWeapon
¶
RunUtilityUltimateWeaponAdmin
¶
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
¶
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.
ChartSnapshotAdmin
¶
ExploreQuery
¶
Bases: Model
Player-authored Explore query stored as a versioned schema.
__str__()
¶
Return a concise display string for admin contexts.
ExploreQueryAdmin
¶
ExploreQueryTemplate
¶
Bases: Model
Admin-managed read-only Explore template shown to all players.
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
¶
PlayerBotAdmin
¶
PlayerBotParameter
¶
PlayerBotParameterAdmin
¶
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
¶
PlayerCard
¶
PlayerCardAdmin
¶
PlayerGuardianChip
¶
PlayerGuardianChipAdmin
¶
PlayerGuardianChipParameter
¶
PlayerGuardianChipParameterAdmin
¶
PlayerScopedAdmin
¶
Bases: ModelAdmin
ModelAdmin that enforces per-player queryset filtering and ownership on create.
PlayerUltimateWeapon
¶
PlayerUltimateWeaponAdmin
¶
PlayerUltimateWeaponParameter
¶
PlayerUltimateWeaponParameterAdmin
¶
Preset
¶
Bases: Model
A configuration snapshot label (no metrics).