Package madrona :: Package google-analytics :: Module admin
[hide private]

Source Code for Module madrona.google-analytics.admin

 1  from django.conf import settings 
 2  from django.contrib import admin 
 3  from django.contrib.sites.models import Site 
 4  from models import Analytics 
 5   
 6   
 7  if getattr(settings, 'GOOGLE_ANALYTICS_MODEL', False): 
8 - class AnalyticsInline(admin.StackedInline):
9 model = Analytics 10 extra = 1
11
12 - class SiteAdminGA(admin.ModelAdmin):
13 list_display = ('domain', 'name') 14 model = Site 15 inlines = [AnalyticsInline]
16 17 admin.site.unregister(Site) 18 admin.site.register(Site, SiteAdminGA) 19