-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.py
54 lines (47 loc) · 2.5 KB
/
admin.py
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
46
47
48
49
50
51
52
53
54
from django.contrib import admin
from models import *
class PlayerAdmin(admin.ModelAdmin):
list_display = ['player_name', 'year', 'position', 'state', 'status', ]
list_editable = ['status',]
search_fields = ['player_name']
list_filter = ['status', 'year', 'position',]
filter_horizontal = [ 'badges' ]
fieldsets = (
(None, {
'fields': ('year', 'player_name', ('first_name', 'last_name'), 'position', ('height', 'weight'), ('city', 'state', 'country', 'distance'), 'highschool', 'bio', 'bio_huskers', 'related_features', ('status', 'target_schools', 'transfer_status', 'juco_name'), ('top_target', 'committed_school', 'hard_commit_elsewhere', 'announcement_date'), 'offer_date', 'commit_date', 'decommit_date', 'official_visit_date', 'signed', 'used_redshirt')
}),
('Photos', {
'fields': ('mugshot', 'feature_photo_credit', 'feature_photo_caption', 'cropped_mug')
}),
('Ratings', {
'fields': (('stars_247', 'rating_national_247', 'rating_position_247', 'profile_link_247'), ('stars_247c', 'rating_national_247c', 'rating_position_247c'), ('stars_rivals', 'rating_national_rivals', 'rating_position_rivals', 'profile_link_rivals'), ('stars_scouts', 'rating_national_espn', 'rating_position_espn', 'profile_link_espn'), ('stars_fox', 'rating_national_scout', 'rating_position_scout', 'profile_link_scout'))
}),
('Hudl', {
'fields': ('hudl_title', 'hudl_image', 'hudl_embed', 'hudl_link')
}),
('Recruiters', {
'fields': ('recruiter_1', 'recruiter_2')
}),
('Badges', {
'fields': ('badges',)
}),
('NFL Draft', {
'fields': ('draft_year', 'draft_team', 'draft_round', 'draft_overall_pick', 'draft_notes',)
}),
('Social media', {
'fields': ('player_twitter', 'player_instagram',)
}), )
class RecruitHeadlineAdmin(admin.ModelAdmin):
list_display = [ 'hed', 'priority', 'source', 'subscription', 'tags' ]
ordering = [ '-priority' ]
list_filter = [ 'tags' ]
class DraftAdmin(admin.ModelAdmin):
ordering = [ '-year' ]
class DraftTeamAdmin(admin.ModelAdmin):
ordering = [ 'team_name' ]
admin.site.register(Player, PlayerAdmin)
admin.site.register(RecruitHeadline, RecruitHeadlineAdmin)
admin.site.register(Badge)
admin.site.register(Recruiter)
admin.site.register(Draft, DraftAdmin)
admin.site.register(DraftTeam, DraftTeamAdmin)