From nobody Sun Dec 22 14:28:13 2024 Delivered-To: importer2@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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556795905; cv=none; d=zoho.com; s=zohoarc; b=C2Sryuk/fOiYpujqRWrf590xHUUmq5VmGrAXpVCsDKTlB7ILshRABBR1LXTuqsnEZryG0GbkpPnJtEuJB4bmAO9wbJxftUdvXHf+a3g+7KnppwRrZblL5ERcnLolblYJ8PG8L36+sScFWLp1Utv+EAV0JZwdfp04I5sQUkvkOg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556795905; 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:ARC-Authentication-Results; bh=JZCUWwYjkdaE6DMGvRyJkIhPQJXh0QZ1xAKIXQ0ezbs=; b=TaNWIqc/iQxChc3XCe6l9rpkdLkFghZAHbzbl3wXyDR0qERtgICSbUmlLdb83NBXNF4cl6lNBRg6PBJJZFpPywSvg9FjCQ/01ErEz7pVdWx+8+FfIdh3D/C2PU0P+iPqTR7LHwyusyhpnBkUMls5mcK4kJgi/cBJA9DUb5FusqI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556795905835717.2777812271518; Thu, 2 May 2019 04:18:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 911A9307D935; Thu, 2 May 2019 11:18:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8708179C7F; Thu, 2 May 2019 11:18:24 +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 7D6BD3FB11; Thu, 2 May 2019 11:18:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x42BIMKO009068 for ; Thu, 2 May 2019 07:18:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E03A17D5B; Thu, 2 May 2019 11:18:22 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 373AD17D56 for ; Thu, 2 May 2019 11:18:22 +0000 (UTC) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1BDAAC0568FE for ; Thu, 2 May 2019 11:18:21 +0000 (UTC) Received: by mail-ot1-f45.google.com with SMTP id s11so1712411otp.0 for ; Thu, 02 May 2019 04:18:21 -0700 (PDT) Received: from localhost.localdomain ([198.59.53.9]) by smtp.gmail.com with ESMTPSA id o1sm19095697otj.11.2019.05.02.04.18.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 04:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bgIEEv5+DXFlZRlFhwOMxE6w931n1Yd069Q7pl2+wtU=; b=oITRLAybsVJcxU5mPh0cOzvSVIlLn0UlYrAw8azctRf7xKDf8unATr9Gb6gwbUP+FB uTq6MchC86V5LFASWZJt7zVIIJKGGJWfVpYcHf+WuEPwTfJBOgadQdRFMlFk/WVO5dhp io6MrDI+qTR3gam7Jy3vYpa/Vl6cqxFVbOzvQJWrbp49zE1mrJyI2Je9EKxNH4NyTOsZ dCxevKfPd4ow9ktufflH6IBzd0DP6Kc/IqjxgaVz7YeODBfG1sOFqoauFlflNAASGWtK 1gfXhgkw6euYXTm2E4F9y31M/T6XZOlqLYCGF56HAD6kbj9zgnOnR6F2HAF4wZaT0VeF j54Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bgIEEv5+DXFlZRlFhwOMxE6w931n1Yd069Q7pl2+wtU=; b=Tlg6VduX/wkTnbGQ+nr7cGabcZ8G9dpMSODaVjqzYady/kJA0nfcSLsRFC3s6O7oqs Mo5iG5L1sZbYl/Vq1FESlnjx/S7lvxhPKlU5aselFqOlwdfrhBy9201OtEcIi1+FShc+ wAoulMKixmJSVxD1xG4hxhW/0AXRnKt7bJi8Qwfce0sbVe1Gz/V4tRjv3qoUwQpZJVd7 biTnuRBQK3kj93+E6bP2eMmk5272TsSeiWs8WDGri+Pdfnab0lsMbR47gXZyjVcEdRMo xE0jn9M8Me/xAGVOTbCctdvC6pZUvj4HYuKj4uEdpOjNxKfjNDp5tsUzU/hpE5ZGl/KX GeyA== X-Gm-Message-State: APjAAAUn0hxd2OkpOxP/CBM8ttzwhuGHctT+hQMuikx0/LwlevHYXCnk 6sX+cxGmmCmILc0uOtAa/1Yxre2RqiE= X-Google-Smtp-Source: APXvYqy8xOIdOWsyeqcVy6Sg7olpxWvDW0IjNL2crhL4BXbCkCqU4y/y4+hYt0mV/oCV5q8kcM7Ibg== X-Received: by 2002:a05:6830:16d3:: with SMTP id l19mr1990285otr.92.1556795900363; Thu, 02 May 2019 04:18:20 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 2 May 2019 05:18:04 -0600 Message-Id: <20190502111804.15843-18-pbonzini@redhat.com> In-Reply-To: <20190502111804.15843-1-pbonzini@redhat.com> References: <20190502111804.15843-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 May 2019 11:18:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 May 2019 11:18:21 +0000 (UTC) for IP:'209.85.210.45' DOMAIN:'mail-ot1-f45.google.com' HELO:'mail-ot1-f45.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.114 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.210.45 mail-ot1-f45.google.com 209.85.210.45 mail-ot1-f45.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 17/17] models: remove property tables 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: , 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 02 May 2019 11:18:24 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" --- api/admin.py | 14 +-------- api/migrations/0053_auto_20190418_1357.py | 37 +++++++++++++++++++++++ api/models.py | 29 +----------------- api/search.py | 2 +- mods/git.py | 3 +- mods/testing.py | 3 +- 6 files changed, 42 insertions(+), 46 deletions(-) create mode 100644 api/migrations/0053_auto_20190418_1357.py diff --git a/api/admin.py b/api/admin.py index bd9e85b..ef0e21b 100644 --- a/api/admin.py +++ b/api/admin.py @@ -9,27 +9,15 @@ # http://opensource.org/licenses/MIT. =20 from django.contrib import admin -from .models import Message, MessageProperty, Module, Project, ProjectProp= erty +from .models import Message, Module, Project from mod import get_module =20 =20 -class ProjectPropertyInline(admin.TabularInline): - model =3D ProjectProperty - extra =3D 0 - - class ProjectAdmin(admin.ModelAdmin): filter_horizontal =3D ('maintainers',) - inlines =3D [ProjectPropertyInline] - - -class MessagePropertyInline(admin.TabularInline): - model =3D MessageProperty - extra =3D 0 =20 =20 class MessageAdmin(admin.ModelAdmin): - inlines =3D [MessagePropertyInline] list_filter =3D [('is_series_head')] search_fields =3D [ 'message_id', diff --git a/api/migrations/0053_auto_20190418_1357.py b/api/migrations/005= 3_auto_20190418_1357.py new file mode 100644 index 0000000..4621bcd --- /dev/null +++ b/api/migrations/0053_auto_20190418_1357.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-04-18 13:57 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies =3D [ + ('api', '0052_populate_property_fields'), + ] + + operations =3D [ + migrations.AlterUniqueTogether( + name=3D'messageproperty', + unique_together=3Dset([]), + ), + migrations.RemoveField( + model_name=3D'messageproperty', + name=3D'message', + ), + migrations.AlterUniqueTogether( + name=3D'projectproperty', + unique_together=3Dset([]), + ), + migrations.RemoveField( + model_name=3D'projectproperty', + name=3D'project', + ), + migrations.DeleteModel( + name=3D'MessageProperty', + ), + migrations.DeleteModel( + name=3D'ProjectProperty', + ), + ] diff --git a/api/models.py b/api/models.py index 9573672..a4fb79c 100644 --- a/api/models.py +++ b/api/models.py @@ -312,16 +312,6 @@ class ProjectResult(Result): return self.project =20 =20 -class ProjectProperty(models.Model): - project =3D models.ForeignKey('Project', on_delete=3Dmodels.CASCADE) - name =3D models.CharField(max_length=3D1024, db_index=3DTrue) - value =3D jsonfield.JSONField() - - class Meta: - unique_together =3D ('project', 'name',) - verbose_name_plural =3D "Project Properties" - - declare_event("SeriesComplete", project=3D"project object", series=3D"series instance that is marked complete") declare_event("SeriesMerged", project=3D"project object", @@ -369,7 +359,7 @@ class MessageManager(models.Manager): return None else: q =3D super(MessageManager, self).get_queryset() - return q.filter(is_series_head=3DTrue).prefetch_related('messagepr= operty_set', 'project') + return q.filter(is_series_head=3DTrue).prefetch_related('project') =20 def find_series(self, message_id, project_name=3DNone): heads =3D self.series_heads(project_name) @@ -807,23 +797,6 @@ class MessageResult(Result): return self.message =20 =20 -class MessageProperty(models.Model): - message =3D models.ForeignKey('Message', on_delete=3Dmodels.CASCADE) - name =3D models.CharField(max_length=3D256) - value =3D jsonfield.JSONField() - - def __str__(self): - if len(self.value) > 30: - val_prev =3D self.value[:30] + "..." - else: - val_prev =3D self.value - return "%s: %s =3D %s" % (self.message.subject, self.name, val_pre= v) - - class Meta: - unique_together =3D ('message', 'name',) - verbose_name_plural =3D "Message Properties" - - class Module(models.Model): """ Module information """ name =3D models.CharField(max_length=3D128, unique=3DTrue) diff --git a/api/search.py b/api/search.py index 1c5aaaf..658ad4a 100644 --- a/api/search.py +++ b/api/search.py @@ -8,7 +8,7 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -from .models import Message, MessageProperty, MessageResult, Result, Queue= dSeries +from .models import Message, MessageResult, Result, QueuedSeries from functools import reduce =20 from django.db import connection diff --git a/mods/git.py b/mods/git.py index 8e868c2..c1909ab 100644 --- a/mods/git.py +++ b/mods/git.py @@ -20,8 +20,7 @@ from django.utils.html import format_html from django.db.models import Q from mod import PatchewModule from event import declare_event, register_handler, emit_event -from api.models import (Message, MessageProperty, Project, - ProjectProperty, Result) +from api.models import (Message, Project, Result) from api.rest import PluginMethodField, reverse_detail from api.views import APILoginRequiredView, prepare_series from patchew.logviewer import LogView diff --git a/mods/testing.py b/mods/testing.py index e5562ba..f238406 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -19,8 +19,7 @@ import datetime import time import math from api.views import APILoginRequiredView -from api.models import (Message, MessageProperty, MessageResult, - Project, ProjectResult, Result) +from api.models import (Message, MessageResult, Project, ProjectResult, Re= sult) from api.rest import PluginMethodField, reverse_detail from api.search import SearchEngine, FLAG_TESTED from event import emit_event, declare_event, register_handler --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel