From patchwork Tue Aug 6 15:39:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stevan Radakovic X-Patchwork-Id: 18801 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5960525DF6 for ; Tue, 6 Aug 2013 15:39:31 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id o19sf1027753qap.11 for ; Tue, 06 Aug 2013 08:39:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:delivered-to:mime-version:to:from:subject :message-id:date:reply-to:sender:errors-to:precedence :x-original-sender:x-original-authentication-results:mailing-list :list-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=TTmOD5rcbLGpu87awBYSKJYGUvLRhrZdGlwP2Mp8OMU=; b=W5aQL82upREtHEyfgqrAT/4Rko/vPJRy8xnAgpRBYErdAnICLTrrQn8k8cgsyln+wf 4i9AtmN3RHHq2QvUe1S0zbIlk5DZ7s2CVyFikdLb6dDyjNCSYnSxGu1EsF4Ng2tkIoe+ QzFmSMwXl5sZfnL3sgeqZyqgqHjrYfTbz79BCQsm9GFtgM7JtqPKOBVwZf6kgxtL0/eI 4La1HKh+efrLcMwmHMuBnpvunpiLznjmZHd5Zar0D4EDZvbdD0umwCLeH4L3jDOEn89+ G/wzzt8+dEHUXMnUF2WBi5ya578W0ZYPDrjcF6gan0XHjWucO+tMbBhXqJmizD2FZaO5 GaLg== X-Received: by 10.236.198.240 with SMTP id v76mr695086yhn.10.1375803570961; Tue, 06 Aug 2013 08:39:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.70 with SMTP id o6ls241162qej.54.gmail; Tue, 06 Aug 2013 08:39:30 -0700 (PDT) X-Received: by 10.58.168.202 with SMTP id zy10mr577348veb.23.1375803570876; Tue, 06 Aug 2013 08:39:30 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id aw7si421713vec.12.2013.08.06.08.39.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 08:39:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id ox1so581825veb.37 for ; Tue, 06 Aug 2013 08:39:30 -0700 (PDT) X-Gm-Message-State: ALoCoQme+bboQbO0MdrjKvsvpoOFEBGdoJ7Rpd4Hdq9fnZwOQnbm5brAfPJOzTuF29gDM9HIBdf7 X-Received: by 10.52.243.201 with SMTP id xa9mr426351vdc.106.1375803570707; Tue, 06 Aug 2013 08:39:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp152251vcb; Tue, 6 Aug 2013 08:39:30 -0700 (PDT) X-Received: by 10.180.182.67 with SMTP id ec3mr2510033wic.1.1375803569337; Tue, 06 Aug 2013 08:39:29 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id ex7si1125324wid.58.2013.08.06.08.39.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 06 Aug 2013 08:39:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1V6jM8-000077-Pf for ; Tue, 06 Aug 2013 15:39:28 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id B72FEE1B19 for ; Tue, 6 Aug 2013 15:39:28 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 416 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 416: Introduce admin.py file since recent django versions support only that one. Message-Id: <20130806153928.15878.631.launchpad@ackee.canonical.com> Date: Tue, 06 Aug 2013 15:39:28 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16721"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: af9f00f45b8f618c6a0cacdfe3a78517e0b2c09f X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Stevan Radaković (stevanr) Related merge proposals: https://code.launchpad.net/~stevanr/lava-server/fix-google-analytics-admin-link/+merge/178761 proposed by: Stevan Radaković (stevanr) ------------------------------------------------------------ revno: 416 [merge] committer: Stevan Radakovic branch nick: trunk timestamp: Tue 2013-08-06 17:39:12 +0200 message: Introduce admin.py file since recent django versions support only that one. added: google_analytics/admin.py modified: google_analytics/models.py --- lp:lava-server https://code.launchpad.net/~linaro-validation/lava-server/trunk You are subscribed to branch lp:lava-server. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription === added file 'google_analytics/admin.py' --- google_analytics/admin.py 1970-01-01 00:00:00 +0000 +++ google_analytics/admin.py 2013-08-06 14:25:08 +0000 @@ -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' --- google_analytics/models.py 2013-07-23 12:14:04 +0000 +++ google_analytics/models.py 2013-08-06 13:38:03 +0000 @@ -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)