=== added file 'google_analytics/admin.py'
@@ -0,0 +1,11 @@
+from django.conf import settings
+from django.contrib import admin
+
+from google_analytics.models import Analytic
+
+class AnalyticAdmin(admin.ModelAdmin):
+ list_display = ('site', 'analytics_code',)
+
+if getattr(settings, 'GOOGLE_ANALYTICS_MODEL', False):
+ admin.site.register(Analytic, AnalyticAdmin)
+
=== modified file 'google_analytics/models.py'
@@ -1,19 +1,7 @@
+from django.contrib import admin
+from django.contrib.sites.models import Site
from django.db import models
-from django.conf import settings
-from django.contrib.sites.admin import SiteAdmin
-from django.contrib.sites.models import Site
-from django.contrib import admin
-
-if getattr(settings, 'GOOGLE_ANALYTICS_MODEL', False):
-
- class Analytic(models.Model):
- site = models.ForeignKey(Site, unique=True)
- analytics_code = models.CharField(blank=True, max_length=100)
-
- def __unicode__(self):
- return u"%s" % (self.analytics_code)
-
- class AnalyticAdmin(admin.ModelAdmin):
- list_display = ('site', 'analytics_code',)
-
- admin.site.register(Analytic, AnalyticAdmin)
+
+class Analytic(models.Model):
+ site = models.ForeignKey(Site, unique=True)
+ analytics_code = models.CharField(blank=True, max_length=100)