Menu

[r190]: / trunk / soccer / admin.py  Maximize  Restore  History

Download this file

46 lines (38 with data), 901 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from django.contrib import admin
from dataplot.soccer.models import *
class ScoreInline(admin.TabularInline):
model = Score
extra=10
class TeamAdmin(admin.ModelAdmin):
inlines=[ScoreInline]
list_display=[
'name',
'game',
'players',
'points',
'goals',
'own_goals',
]
fieldsets=[
(None,{
'fields':['name','game']}),
]
admin.site.register(Team,TeamAdmin)
class GameAdmin(admin.ModelAdmin):
list_display=[
'date',
'hi_score',
'lo_score',
'differential',
]
fieldsets=(
(None,{
'fields':['date']}),
)
admin.site.register(Game,GameAdmin)
class PlayerAdmin(admin.ModelAdmin):
fieldsets=(
(None,{'fields':['name']}),
)
list_display=tuple(['name']+list(PLAYER_STATS))
admin.site.register(Player,PlayerAdmin)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.