{"id":833275,"url":"http://patchwork.ozlabs.org/api/1.2/patches/833275/?format=json","web_url":"http://patchwork.ozlabs.org/project/patchwork/patch/20171102102844.18931-2-stephen@that.guru/","project":{"id":16,"url":"http://patchwork.ozlabs.org/api/1.2/projects/16/?format=json","name":"Patchwork","link_name":"patchwork","list_id":"patchwork.lists.ozlabs.org","list_email":"patchwork@lists.ozlabs.org","web_url":"http://jk.ozlabs.org/projects/patchwork/","scm_url":"git://github.com/getpatchwork/patchwork","webscm_url":"https://github.com/getpatchwork/patchwork","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20171102102844.18931-2-stephen@that.guru>","list_archive_url":null,"date":"2017-11-02T10:28:36","name":"[v2,1/9] models: Remove 'permalink' decorator","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"baff24f9f92ba2fa91d6544024d136f4aa0f2e11","submitter":{"id":69991,"url":"http://patchwork.ozlabs.org/api/1.2/people/69991/?format=json","name":"Stephen Finucane","email":"stephen@that.guru"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/patchwork/patch/20171102102844.18931-2-stephen@that.guru/mbox/","series":[{"id":11467,"url":"http://patchwork.ozlabs.org/api/1.2/series/11467/?format=json","web_url":"http://patchwork.ozlabs.org/project/patchwork/list/?series=11467","date":"2017-11-02T10:28:35","name":"Add support for Django 1.11","version":2,"mbox":"http://patchwork.ozlabs.org/series/11467/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/833275/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/833275/checks/","tags":{},"related":[],"headers":{"Return-Path":"<patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","patchwork@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","patchwork@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3ySLtL6Vsrz9t30\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 21:29:30 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3ySLtL513RzDr6l\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 21:29:30 +1100 (AEDT)","from burlywood.maple.relay.mailchannels.net\n\t(burlywood.maple.relay.mailchannels.net [23.83.214.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3ySLsw04wTzDqlM\n\tfor <patchwork@lists.ozlabs.org>;\n\tThu,  2 Nov 2017 21:29:06 +1100 (AEDT)","from relay.mailchannels.net (localhost [127.0.0.1])\n\tby relay.mailchannels.net (Postfix) with ESMTP id 15AF110967B\n\tfor <patchwork@lists.ozlabs.org>;\n\tThu,  2 Nov 2017 10:29:00 +0000 (UTC)","from one.mxroute.com (unknown [100.96.146.10])\n\t(Authenticated sender: mxroute)\n\tby relay.mailchannels.net (Postfix) with ESMTPA id 93F5A109B1F\n\tfor <patchwork@lists.ozlabs.org>;\n\tThu,  2 Nov 2017 10:28:59 +0000 (UTC)","from one.mxroute.com (one-outgoing.mxroute.com [172.20.95.244])\n\t(using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)\n\tby 0.0.0.0:2500 (trex/5.9.14); Thu, 02 Nov 2017 10:29:00 +0000"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=that.guru header.i=@that.guru\n\theader.b=\"OwiwLy5Y\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=that.guru header.i=@that.guru\n\theader.b=\"OwiwLy5Y\"; dkim-atps=neutral","ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=that.guru\n\t(client-ip=23.83.214.26; helo=burlywood.maple.relay.mailchannels.net; \n\tenvelope-from=stephen@that.guru; receiver=<UNKNOWN>)","lists.ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=that.guru header.i=@that.guru\n\theader.b=\"OwiwLy5Y\"; dkim-atps=neutral"],"X-Sender-Id":["mxroute|x-authuser|stephen@that.guru","mxroute|x-authuser|stephen@that.guru"],"X-MC-Relay":"Neutral","X-MailChannels-SenderId":"mxroute|x-authuser|stephen@that.guru","X-MailChannels-Auth-Id":"mxroute","X-Cure-Snatch":"2326b1b41198ebd3_1509618539848_1997657762","X-MC-Loop-Signature":"1509618539848:2276793983","X-MC-Ingress-Time":"1509618539847","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru;\n\ts=default;\n\th=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:\n\tSender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:\n\tContent-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:\n\tResent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:\n\tList-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=/td4g58s6VlyXjr1fJs6SEUd6oQiNVJNBMbVfWoxYg0=;\n\tb=OwiwLy5YUtrUOl7U2OnN/21RBE\n\tkR9oocG0MSfJDz9P3pIsoN+46YkjBH2zZ13kT7ySdAWbScFeX7gnDY3aOeX7an5vFxoB5GQcnLV6U\n\toB+xcSmwq3VgtO0U8TL3LWfjLxjORuURjRAQw4AgYtHJI5itiNSn3eTahbFBCaC43fB4SrWp8AvTJ\n\tgHvhQbaWaKtwsE+JnMk2DPqXw93VbocrQY7LdoEUM9zC6gYYtBVP+IFKO0C70rzcBwvZ0z3lbLDMu\n\tmlQKEGM5qz5VmYWOkXYoFpfMQr9AVpRrEcFDmOkCQgBzTEm/w0nRB2g2+X0lfhXNErefSlYCME5Fq\n\tqKcF/mLQ==;","From":"Stephen Finucane <stephen@that.guru>","To":"patchwork@lists.ozlabs.org","Subject":"[PATCH v2 1/9] models: Remove 'permalink' decorator","Date":"Thu,  2 Nov 2017 10:28:36 +0000","Message-Id":"<20171102102844.18931-2-stephen@that.guru>","X-Mailer":"git-send-email 2.13.6","In-Reply-To":"<20171102102844.18931-1-stephen@that.guru>","References":"<20171102102844.18931-1-stephen@that.guru>","X-AuthUser":"stephen@that.guru","X-BeenThere":"patchwork@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Patchwork development <patchwork.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/patchwork>,\n\t<mailto:patchwork-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/patchwork/>","List-Post":"<mailto:patchwork@lists.ozlabs.org>","List-Help":"<mailto:patchwork-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/patchwork>,\n\t<mailto:patchwork-request@lists.ozlabs.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Patchwork\"\n\t<patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"This is deprecated in Django 1.11 [1] Let's pre-empt the inevitable\nwarnings...or not [2].\n\n[1] https://docs.djangoproject.com/en/dev/releases/1.11/#features-deprecated-in-1-11\n[2] https://docs.djangoproject.com/en/dev/releases/1.11/#deprecating-warnings-are-no-longer-loud-by-default\n\nSigned-off-by: Stephen Finucane <stephen@that.guru>\n---\n patchwork/models.py | 17 ++++++++---------\n 1 file changed, 8 insertions(+), 9 deletions(-)","diff":"diff --git a/patchwork/models.py b/patchwork/models.py\nindex d4075cf3..3bf770d6 100644\n--- a/patchwork/models.py\n+++ b/patchwork/models.py\n@@ -34,6 +34,7 @@ from django.utils.encoding import python_2_unicode_compatible\n from django.utils.functional import cached_property\n \n from patchwork.compat import is_authenticated\n+from patchwork.compat import reverse\n from patchwork.fields import HashField\n from patchwork.hasher import hash_diff\n \n@@ -548,13 +549,11 @@ class Patch(SeriesMixin, Submission):\n \n         return counts\n \n-    @models.permalink\n     def get_absolute_url(self):\n-        return ('patch-detail', (), {'patch_id': self.id})\n+        return reverse('patch-detail', kwargs={'patch_id': self.id})\n \n-    @models.permalink\n     def get_mbox_url(self):\n-        return ('patch-mbox', (), {'patch_id': self.id})\n+        return reverse('patch-mbox', kwargs={'patch_id': self.id})\n \n     def __str__(self):\n         return self.name\n@@ -776,17 +775,17 @@ class Bundle(models.Model):\n         return BundlePatch.objects.create(bundle=self, patch=patch,\n                                           order=max_order + 1)\n \n-    @models.permalink\n     def get_absolute_url(self):\n-        return ('bundle-detail', (), {\n+        return reverse('bundle-detail', kwargs={\n             'username': self.owner.username,\n             'bundlename': self.name,\n         })\n \n-    @models.permalink\n     def get_mbox_url(self):\n-        return ('bundle-mbox', (), {'bundlename': self.name,\n-                                    'username': self.owner.username})\n+        return reverse('bundle-mbox', kwargs={\n+            'bundlename': self.name,\n+            'username': self.owner.username\n+        })\n \n     class Meta:\n         unique_together = [('owner', 'name')]\n","prefixes":["v2","1/9"]}