Skip to content

Commit

Permalink
Changed admin display of Game (#782)
Browse files Browse the repository at this point in the history
* Displaying players' first names in admin

* newline

* Added blank line

* PR comments
  • Loading branch information
riaJha97 committed Sep 4, 2018
1 parent c0b0001 commit 7a299b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aimmo/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@

from models import Avatar, Game


class GameDataAdmin(admin.ModelAdmin):
list_display = ['id', 'name']

readonly_fields = ['players']

def players(self, obj):
return "\n".join([u.first_name for u in obj.can_play.all()])

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

0 comments on commit 7a299b0

Please sign in to comment.