From nobody Mon Sep 16 19:21:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail header.i=fam@euphon.net; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1543415766174844.0862855776232; Wed, 28 Nov 2018 06:36:06 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 001483091D52; Wed, 28 Nov 2018 14:36:04 +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 E11FD7A5E6; Wed, 28 Nov 2018 14:36:04 +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 D38D1181B9E5; Wed, 28 Nov 2018 14:36:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wASEa3M2031772 for ; Wed, 28 Nov 2018 09:36:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2A25419493; Wed, 28 Nov 2018 14:36:03 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1764C1948E; Wed, 28 Nov 2018 14:36:03 +0000 (UTC) Received: from sender1.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by mx1.redhat.com (Postfix) with ESMTP id DF81B30BCBFE; Wed, 28 Nov 2018 14:35:56 +0000 (UTC) Received: from localhost.localdomain (123.112.65.99 [123.112.65.99]) by mx.zoho.com.cn with SMTPS id 1543415748846631.5689003729335; Wed, 28 Nov 2018 22:35:48 +0800 (CST) ARC-Seal: i=1; a=rsa-sha256; t=1543415754; cv=none; d=zoho.com.cn; s=zohoarc; b=DsjG8dEPnX/g8Qs1oqXiJMfPmEIazrxUBcgF8yuCJYHiDBYQVqGZtW+PGgVX+XRr7xTgiKX7GZSvlaL4booUB1vkwFSpX+ms3/5QiWnH3M0m4ybE3xwJb051WM71+NPTox6SYttQ0LwXlVjh6XWxbZ3dnCnYlMQ6C9BF6phAhfM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1543415754; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=RY/J0nTL95h1WEXt4WSeCasZevo9wDzfaBXn9MgZgtw=; b=eXJxd9sYBknCBDiLSOH2d5aaPTsxORY2+MqHyB9I7qqDAf+hv7BXpwXkdN31yMQLGWJ5UTK7JICAKeredzeZGj6o7dOYG3Zgp7AOjQ5Yd7wNKdwzA+Bjnh6D9hNSHolg1K84LvTDpiobvX9UGpT5UYHp++5N4HFNFeZWOVR9YKc= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1543415754; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=2307; bh=RY/J0nTL95h1WEXt4WSeCasZevo9wDzfaBXn9MgZgtw=; b=dusNk9z3ouVKRMk16sjit8JBBfqHm0775EbrTPhcN+uSN27l4pPG4PyDmNfZUmcM YILh4Wy9qXAhRCRNFu6nkESYrMNZItYfgPeEszselC8pmRGnUa7uF/XIAkqxJ2VYqzu QEuE5hv4mG76mDqVUR++YoPMxfgtjK/6YkatFxOY= From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 28 Nov 2018 22:34:58 +0800 Message-Id: <20181128143505.27730-6-fam@euphon.net> In-Reply-To: <20181128143505.27730-1-fam@euphon.net> References: <20181128143505.27730-1-fam@euphon.net> X-ZohoCNMailClient: External X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 28 Nov 2018 14:36:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 28 Nov 2018 14:36:01 +0000 (UTC) for IP:'163.53.93.243' DOMAIN:'sender2-op-o12.zoho.com.cn' HELO:'sender1.zoho.com.cn' FROM:'fam@euphon.net' RCPT:'' X-RedHat-Spam-Score: -0.101 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_PASS) 163.53.93.243 sender2-op-o12.zoho.com.cn 163.53.93.243 sender2-op-o12.zoho.com.cn X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Cc: Fam Zheng Subject: [Patchew-devel] [PATCH v2 05/12] model: Introduce WatchedQuery 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 28 Nov 2018 14:36:05 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Fam Zheng Every user can have a record in WatchedQuery. The query in this record is going to be run against every new series, and if matched, the patches will be added to the 'watched' queue, making this the 3rd specially purposed queue. Signed-off-by: Fam Zheng --- api/migrations/0044_watchedquery.py | 26 ++++++++++++++++++++++++++ api/models.py | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 api/migrations/0044_watchedquery.py diff --git a/api/migrations/0044_watchedquery.py b/api/migrations/0044_watc= hedquery.py new file mode 100644 index 0000000..6568c13 --- /dev/null +++ b/api/migrations/0044_watchedquery.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.16 on 2018-11-28 13:25 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies =3D [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('api', '0043_auto_20181120_0636'), + ] + + operations =3D [ + migrations.CreateModel( + name=3D'WatchedQuery', + fields=3D[ + ('id', models.AutoField(auto_created=3DTrue, primary_key= =3DTrue, serialize=3DFalse, verbose_name=3D'ID')), + ('query', models.TextField(help_text=3D'Watched query')), + ('user', models.ForeignKey(on_delete=3Ddjango.db.models.de= letion.CASCADE, related_name=3D'watched_queries', to=3Dsettings.AUTH_USER_M= ODEL)), + ], + ), + ] diff --git a/api/models.py b/api/models.py index c2cd2ac..e56f059 100644 --- a/api/models.py +++ b/api/models.py @@ -442,6 +442,7 @@ class Queue(models.Model): # Special purposed queues: # accept: When user marked series as "accepted" # reject: When user marked series as "rejected" + # watched: When a series matches user's watched query name =3D models.CharField(max_length=3D1024, help_text=3D"Name of the = queue") =20 class Meta: @@ -767,3 +768,8 @@ class Module(models.Model): =20 def __str__(self): return self.name + +class WatchedQuery(models.Model): + """ User watched query """ + user =3D models.ForeignKey(User, on_delete=3Dmodels.CASCADE, related_n= ame=3D'watched_queries') + query =3D models.TextField(blank=3DFalse, help_text=3D"Watched query") --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel