File size: 1,708 Bytes
aff4b27
4618a46
aff4b27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4618a46
aff4b27
 
 
 
 
 
 
 
 
4618a46
 
 
 
 
aff4b27
 
 
 
 
4618a46
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
from django.contrib import admin
from .models import Bhagat, Event, Attendance,  Notification, Region, BhajanCategory, Bhajan
from import_export.admin import ImportExportModelAdmin

# Register your models here.
class BhagatAdmin(ImportExportModelAdmin):
    list_display = ('__str__', 'email', 'region', 'user_type', 'assigned_to')
    list_filter = ('region', 'user_type')
    search_fields = ('__str__', 'email', 'region', 'user_type', 'assigned_to')

class RegionAdmin(ImportExportModelAdmin):
    list_display = ('name',)

class BhajanCategoryAdmin(ImportExportModelAdmin):
    list_display = ('name', 'link')
    search_fields = ('name',)
    
class BhajanAdmin(ImportExportModelAdmin):
    list_display = ('title', 'title_guj', 'category', 'lyricsBtn')
    search_fields = ('title', 'title_guj', 'category__name')
    list_filter = ('category',)
    #  'musicPreivew',

class EventAdmin(ImportExportModelAdmin):
    list_display = ('title', 'date', 'region', 'is_approved', 'color')
    list_filter = ('region', 'is_approved', 'color')
    search_fields = ('title', 'date', 'region', 'is_approved', 'color')
    list_editable = ('is_approved', 'color')

class NotificationAdmin(ImportExportModelAdmin):
    list_display = ('sender', 'title','timestamp', 'notification_type')
    list_filter = ('notification_type',)
    search_fields = ('sender__first_name', 'title', 'notification_type')

admin.site.register(Bhagat, BhagatAdmin)
admin.site.register(Region, RegionAdmin)
admin.site.register(BhajanCategory, BhajanCategoryAdmin)
admin.site.register(Bhajan, BhajanAdmin)
admin.site.register(Event, EventAdmin)
admin.site.register(Notification, NotificationAdmin)