You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
410 B
19 lines
410 B
# -*- coding: utf-8 -*-
|
|
from django.contrib import admin
|
|
|
|
from models import Slot, Banner
|
|
|
|
|
|
class BannerInline(admin.TabularInline):
|
|
model = Banner
|
|
extra = 0
|
|
readonly_fields = ('views_count', 'clicks_count', 'ctr',)
|
|
|
|
|
|
class SlotAdmin(admin.ModelAdmin):
|
|
list_per_page = 25
|
|
prepopulated_fields = {'reverse_id': ('name',)}
|
|
inlines = [BannerInline,]
|
|
|
|
|
|
admin.site.register(Slot, SlotAdmin)
|
|
|