Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

from django.conf import settings 

from django.contrib import admin 

from django.contrib.sites.models import Site 

from models import Analytics 

 

 

if getattr(settings, 'GOOGLE_ANALYTICS_MODEL', False): 

    class AnalyticsInline(admin.StackedInline): 

        model = Analytics 

        extra = 1 

 

    class SiteAdminGA(admin.ModelAdmin): 

        list_display = ('domain', 'name') 

        model = Site 

        inlines = [AnalyticsInline] 

 

    admin.site.unregister(Site) 

    admin.site.register(Site, SiteAdminGA)