Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Change admin display of avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
Ria Jha committed Sep 14, 2018
1 parent 714ca78 commit 036c50d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions aimmo/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.contrib import admin

from models import Avatar, Game


Expand All @@ -11,5 +10,18 @@ class GameDataAdmin(admin.ModelAdmin):
def players(self, obj):
return "\n".join([u.first_name for u in obj.can_play.all()])

admin.site.register(Avatar)
class AvatarDataAdmin(admin.ModelAdmin):
list_display = ['id','game_identifier', 'game_name', 'owner_name']

def owner_name(self, obj):
return obj.owner.first_name

def game_name(self, obj):
return obj.game.name

def game_identifier(self, obj):
return obj.game.id


admin.site.register(Game, GameDataAdmin)
admin.site.register(Avatar, AvatarDataAdmin)

0 comments on commit 036c50d

Please sign in to comment.