-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathadmin.py
48 lines (36 loc) · 1.15 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
# -*- coding: utf-8 -*-
from django.contrib import admin
from models import *
class AdvertiserAdmin(admin.ModelAdmin):
"""admin class"""
class ProductCategoryAdmin(admin.ModelAdmin):
"""admin class"""
class DealAdmin(admin.ModelAdmin):
prepopulated_fields = {
'slug': ( 'title', )
}
class ProfileAdmin(admin.ModelAdmin):
"""admin class"""
class EmailSubAdmin(admin.ModelAdmin):
"""admin class"""
class CouponAdmin(admin.ModelAdmin):
"""admin class"""
list_display = ['user', 'deal', 'status']
list_filter = ('user', 'deal')
list_per_page = 100
search_fields = ['user', 'deal']
class CityAdmin(admin.ModelAdmin):
"""admin class"""
list_display = ['name', 'province', 'is_active']
list_per_page = 100
search_fields = ['name']
prepopulated_fields = {
'slug': ( 'name', )
}
admin.site.register(ProductCategory, ProductCategoryAdmin)
admin.site.register(Deal, DealAdmin)
admin.site.register(City, CityAdmin)
admin.site.register(Profile, ProfileAdmin)
admin.site.register(Coupon, CouponAdmin)
admin.site.register(Advertiser, AdvertiserAdmin)
admin.site.register(EmailSubscribe, EmailSubAdmin)