Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id AFC22E00D35; Tue, 22 Nov 2016 09:56:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.192.175 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id D3E6FE00CCD for ; Tue, 22 Nov 2016 09:56:10 -0800 (PST) Received: by mail-pf0-f175.google.com with SMTP id 189so5173885pfz.3 for ; Tue, 22 Nov 2016 09:56:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h+WuI/ecj8w9FmhRoMoeUgCzllUFuzk+5VaSuZ4Qprk=; b=tnIlsi1+GmjwCWwy90G/TPSLAP+VfGBs9OcbwLmkbOL5c5HmupEplH+Qol7ydlXsKv rMpzA2S5eVDbOgQ8y6hy46P8ONbiHXnZAMcNzcjYd9KuGwyK1XOvshB9N6PZsX3WAls4 2UDT455NB1R3fcbygy3RYZm7LwQpjt2LJtzwYg67ubBJ9/HQcN0v1NSX2akR/K/T1W2u t5EchMfo4C8aOVhOhEof4kZ1dGEd+4qr4n5QZhaKEwqeE0SDlE9OH2dFszG9eZQsNf0v jY9gDh4IIa0ebdCiDuq3gNzJE2wBU1xOPDAAi9HFE1tvfvxv5MmW7p7tjEEmZ9fcK/Gx EyNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h+WuI/ecj8w9FmhRoMoeUgCzllUFuzk+5VaSuZ4Qprk=; b=PaC7fnj3D8S9NtA2lhG/aKVObsrq7d8Q1MPIsZPLYbe4OwolU2NH/sMEAYWgRaR9Oo B5+ajTn5UXLO6Xf4OaoLdD0LsPWQTEywc7jeGUGq66J6F676ZAk0E3Rphn+Prh9h8J1y R1tNpK9DdlIPPz0BZcShyNxNZVwVlGE/I0uRcAm/pJSfHRO4mo0V9GZqIKQT1jANCm4f Wh2cEtVtIsHhwXPKKHcc9jZHfBww0cKWNtRQrE7CJx18bihCmPdfSFoPXOMw8ek9XEIf KkEBMIutPVrZcL8SlHYi6rvQJsq+j4EUhLvLjCvcsk1LTXnOSQixOymqST3Mh7o0Oyys d7gw== X-Gm-Message-State: AKaTC005a6RJ2FYY9n1rDBElJNhEk2ntisA5Y7jyQh108p3ycmED0qA0+uo1c2eO6KFayGlj X-Received: by 10.84.172.131 with SMTP id n3mr1989880plb.5.1479837370269; Tue, 22 Nov 2016 09:56:10 -0800 (PST) Received: from orion.ger.corp.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id y6sm28758504pge.27.2016.11.22.09.56.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 09:56:09 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 22 Nov 2016 17:55:33 +0000 Message-Id: <1479837338-15969-14-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479837338-15969-1-git-send-email-michael.g.wood@intel.com> References: <1479837338-15969-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 13/18] toaster: orm models Project class Fix pyflake errors X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2016 17:56:32 -0000 Signed-off-by: Michael Wood --- bitbake/lib/toaster/orm/models.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index fd15fbe..394c886 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -38,6 +38,7 @@ import re import itertools from signal import SIGUSR1 + import logging logger = logging.getLogger("toaster") @@ -178,24 +179,27 @@ class ProjectManager(models.Manager): else: return projects[0] + class Project(models.Model): - search_allowed_fields = ['name', 'short_description', 'release__name', 'release__branch_name'] + search_allowed_fields = ['name', 'short_description', 'release__name', + 'release__branch_name'] name = models.CharField(max_length=100) short_description = models.CharField(max_length=50, blank=True) bitbake_version = models.ForeignKey('BitbakeVersion', null=True) - release = models.ForeignKey("Release", null=True) - created = models.DateTimeField(auto_now_add = True) - updated = models.DateTimeField(auto_now = True) + release = models.ForeignKey("Release", null=True) + created = models.DateTimeField(auto_now_add=True) + updated = models.DateTimeField(auto_now=True) # This is a horrible hack; since Toaster has no "User" model available when # running in interactive mode, we can't reference the field here directly - # Instead, we keep a possible null reference to the User id, as not to force + # Instead, we keep a possible null reference to the User id, + # as not to force # hard links to possibly missing models - user_id = models.IntegerField(null = True) - objects = ProjectManager() + user_id = models.IntegerField(null=True) + objects = ProjectManager() # set to True for the project which is the default container # for builds initiated by the command line etc. - is_default = models.BooleanField(default = False) + is_default= models.BooleanField(default=False) def __unicode__(self): return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version) -- 2.7.4