From nobody Mon Sep 16 19:29:22 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601049544; cv=none; d=zohomail.com; s=zohoarc; b=IPcBDkaLxu3caHMnyVVr83WgT6O+RY3YVGbEisRmCZO74rvR4b9uobPA1q1i20u/r1vy/UF7GnNC2RLnDvnF1ORkzrN5F8SsR3U8m59KERMeK5U5NpXMSrwYlXob+Uqm7CO1/r8EaFWqrzZsxqHD8t7PPO8Zv2hTXMDHAM6jZ5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601049544; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=99DfogqohcpSDgMHOOSnz+6jfDlKSyNjaThc4LO9S0w=; b=WdMhlQoc2aR8SWLKQAMBqD8R7d6IBdSDA4ffFcwu4KT3KWHTrmeLOuvFGPy4T1YvVOHKDYK1tyibMxaZNrqOzB5hRgWuC4cusmiFvjNQCgcahbXCgJFa8sqg4Iogvjr7C2cOhP1s3p/iZmBPwomLPsEjSZlYVtoiPJVp7E4FVsg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16010495449041013.8273604217475; Fri, 25 Sep 2020 08:59:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-DxYRK4rjOOiHmOMlNt-U-Q-1; Fri, 25 Sep 2020 11:59:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7AB39AE82A; Fri, 25 Sep 2020 15:59:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 729A19CBA; Fri, 25 Sep 2020 15:59:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6B6C71826D2B; Fri, 25 Sep 2020 15:59:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08PFwwT7025827 for ; Fri, 25 Sep 2020 11:58:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD34311E5AC; Fri, 25 Sep 2020 15:58:58 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8A1511E5AB for ; Fri, 25 Sep 2020 15:58:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0BD980351B for ; Fri, 25 Sep 2020 15:58:58 +0000 (UTC) Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-eRY9B9TaO1OGJTLmQxzZ7Q-1; Fri, 25 Sep 2020 11:58:54 -0400 Received: from localhost (host109-159-73-6.range109-159.btcentralplus.com [109.159.73.6]) by mx.zoho.com.cn with SMTPS id 1601048608758942.44521579511; Fri, 25 Sep 2020 23:43:28 +0800 (CST) X-MC-Unique: DxYRK4rjOOiHmOMlNt-U-Q-1 X-MC-Unique: eRY9B9TaO1OGJTLmQxzZ7Q-1 From: fam@euphon.net To: patchew-devel@redhat.com Message-ID: <20200925154243.685513-3-fam@euphon.net> Date: Fri, 25 Sep 2020 16:42:34 +0100 In-Reply-To: <20200925154243.685513-1-fam@euphon.net> References: <20200925154243.685513-1-fam@euphon.net> MIME-Version: 1.0 X-ZohoCNMailClient: External X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 08PFwwT7025827 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 02/11] models: Add on_delete to foreign fields X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Fam Zheng This is mandatory in newer djangos. --- api/models.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/models.py b/api/models.py index fdc4fc0..69b6817 100644 --- a/api/models.py +++ b/api/models.py @@ -333,7 +333,8 @@ class Project(models.Model): =20 =20 class ProjectResult(Result): - project =3D models.ForeignKey(Project, related_name=3D"results") + project =3D models.ForeignKey(Project, related_name=3D"results", + on_delete=3Dmodels.CASCADE) =20 @property def obj(self): @@ -527,8 +528,8 @@ def HeaderFieldModel(**args): =20 =20 class QueuedSeries(models.Model): - user =3D models.ForeignKey(User) - message =3D models.ForeignKey("Message") + user =3D models.ForeignKey(User, on_delete=3Dmodels.CASCADE) + message =3D models.ForeignKey("Message", on_delete=3Dmodels.CASCADE) # Special purposed queues: # accept: When user marked series as "accepted" # reject: When user marked series as "rejected" @@ -948,7 +949,8 @@ class Message(models.Model): =20 =20 class MessageResult(Result): - message =3D models.ForeignKey(Message, related_name=3D"results") + message =3D models.ForeignKey(Message, related_name=3D"results", + on_delete=3Dmodels.CASCADE) =20 @property def obj(self): --=20 2.25.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel