Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/710290/?format=api
{ "id": 710290, "url": "http://patchwork.ozlabs.org/api/patches/710290/?format=api", "web_url": "http://patchwork.ozlabs.org/project/patchwork/patch/20170102212347.18089-3-stephen@that.guru/", "project": { "id": 16, "url": "http://patchwork.ozlabs.org/api/projects/16/?format=api", "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": "<20170102212347.18089-3-stephen@that.guru>", "list_archive_url": null, "date": "2017-01-02T21:23:47", "name": "[v2,3/3] REST: Integrate ordering", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "832e9b77e845eeae7e611f869c2a3a9bd628be44", "submitter": { "id": 69991, "url": "http://patchwork.ozlabs.org/api/people/69991/?format=api", "name": "Stephen Finucane", "email": "stephen@that.guru" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/patchwork/patch/20170102212347.18089-3-stephen@that.guru/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/710290/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/710290/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 3tsqnz5XZvz9sf9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 3 Jan 2017 08:24:07 +1100 (AEDT)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3tsqnz4NvszDqFm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 3 Jan 2017 08:24:07 +1100 (AEDT)", "from catfish.maple.relay.mailchannels.net\n\t(catfish.maple.relay.mailchannels.net [23.83.214.32])\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 3tsqnv4gCMzDqDt\n\tfor <patchwork@lists.ozlabs.org>;\n\tTue, 3 Jan 2017 08:24:03 +1100 (AEDT)", "from relay.mailchannels.net (localhost [127.0.0.1])\n\tby relay.mailchannels.net (Postfix) with ESMTP id E3FF4100804;\n\tMon, 2 Jan 2017 21:23:58 +0000 (UTC)", "from one.mxroute.com (ip-10-229-2-62.us-west-2.compute.internal\n\t[10.229.2.62])\n\tby relay.mailchannels.net (Postfix) with ESMTPA id 25583100079;\n\tMon, 2 Jan 2017 21:23:58 +0000 (UTC)", "from one.mxroute.com ([UNAVAILABLE]. [10.29.28.91])\n\t(using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384)\n\tby 0.0.0.0:2500 (trex/5.7.8); Mon, 02 Jan 2017 21:23:58 +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=\"D/1tUnZK\"; 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=\"D/1tUnZK\"; 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=\"D/1tUnZK\"; 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-MC-Loop-Signature": "1483392238482:574770156", "X-MC-Ingress-Time": "1483392238482", "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=NwvD2S1JYAuPAD1zl/b6vOyk72WKm3dqlYrV/ihrEsM=;\n\tb=D/1tUnZKHhnpFwRLd+ac+U8i3I\n\tnc/+0d/M1saUehpWwurorKLVaarkh4wr3RHnKqVutn/9aTRkk3Y/Usm1wwb3P4p/edTCCj6LHL2Pe\n\tA1Akm3Kxo8PxjBF+2nTIaUyKXZCxve/cTerq1j2scAAHJ1Q61Q2Mt2lkYWM8a32DE2tx2ynDsVF9L\n\tLgO3IIA486ugJOfhrUW3yBx43Cw6q+wodWwkLVRVtr7rogMC5Abqhfn6uxn55oSDyh+4u9QO+hd9C\n\tybKAChyuFmqnjvpQ4ElcjCfjnXcX3tNOvzS9PWZlOJmV9Br505vbveAip1JLnApBa5pGfJqAMdh3k\n\tON2BSfHw==;", "From": "Stephen Finucane <stephen@that.guru>", "To": "patchwork@lists.ozlabs.org", "Subject": "[PATCH v2 3/3] REST: Integrate ordering", "Date": "Mon, 2 Jan 2017 21:23:47 +0000", "Message-Id": "<20170102212347.18089-3-stephen@that.guru>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20170102212347.18089-1-stephen@that.guru>", "References": "<20170102212347.18089-1-stephen@that.guru>", "X-AuthUser": "stephen@that.guru", "X-BeenThere": "patchwork@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "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>", "Cc": "Andrew Donnellan <andrew.donnellan@au1.ibm.com>", "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": "Order by way of the 'order' parameter on many endpoints.\n\nSigned-off-by: Stephen Finucane <stephen@that.guru>\nCc: Andrew Donnellan <andrew.donnellan@au1.ibm.com>\nCc: Russell Currey <ruscur@russell.cc>\n---\n patchwork/api/cover.py | 1 +\n patchwork/api/patch.py | 2 ++\n patchwork/api/person.py | 1 +\n patchwork/api/project.py | 1 +\n patchwork/api/series.py | 1 +\n patchwork/api/user.py | 1 +\n patchwork/settings/base.py | 2 ++\n 7 files changed, 9 insertions(+)", "diff": "diff --git a/patchwork/api/cover.py b/patchwork/api/cover.py\nindex 0b6b546..8b8d47b 100644\n--- a/patchwork/api/cover.py\n+++ b/patchwork/api/cover.py\n@@ -69,6 +69,7 @@ class CoverLetterList(ListAPIView):\n serializer_class = CoverLetterListSerializer\n filter_class = CoverLetterFilter\n search_fields = ('name',)\n+ ordering_fields = ('id', 'name', 'date', 'submitter')\n \n def get_queryset(self):\n qs = CoverLetter.objects.all().prefetch_related('series')\\\ndiff --git a/patchwork/api/patch.py b/patchwork/api/patch.py\nindex fc5a0ee..e8fb0ef 100644\n--- a/patchwork/api/patch.py\n+++ b/patchwork/api/patch.py\n@@ -120,6 +120,8 @@ class PatchList(ListAPIView):\n serializer_class = PatchListSerializer\n filter_class = PatchFilter\n search_fields = ('name',)\n+ ordering_fields = ('id', 'name', 'project', 'date', 'state', 'archived',\n+ 'submitter', 'check')\n \n def get_queryset(self):\n return Patch.objects.all().with_tag_counts()\\\ndiff --git a/patchwork/api/person.py b/patchwork/api/person.py\nindex 10cf781..7947f82 100644\n--- a/patchwork/api/person.py\n+++ b/patchwork/api/person.py\n@@ -47,6 +47,7 @@ class PersonList(PersonMixin, ListAPIView):\n \"\"\"List users.\"\"\"\n \n search_fields = ('name', 'email')\n+ ordering_fields = ('id', 'name', 'email')\n \n \n class PersonDetail(PersonMixin, RetrieveAPIView):\ndiff --git a/patchwork/api/project.py b/patchwork/api/project.py\nindex 8901ab4..ce3ed58 100644\n--- a/patchwork/api/project.py\n+++ b/patchwork/api/project.py\n@@ -76,6 +76,7 @@ class ProjectList(ProjectMixin, ListAPIView):\n \n search_fields = ('link_name', 'list_id', 'list_email', 'web_url',\n 'scm_url', 'webscm_url')\n+ ordering_fields = ('id', 'name', 'link_name', 'list_id')\n \n \n class ProjectDetail(ProjectMixin, RetrieveUpdateAPIView):\ndiff --git a/patchwork/api/series.py b/patchwork/api/series.py\nindex 996094b..6fe0e21 100644\n--- a/patchwork/api/series.py\n+++ b/patchwork/api/series.py\n@@ -57,6 +57,7 @@ class SeriesList(SeriesMixin, ListAPIView):\n \n filter_class = SeriesFilter\n search_fields = ('name',)\n+ ordering_fields = ('id', 'name', 'date', 'submitter', 'received_all')\n \n \n class SeriesDetail(SeriesMixin, RetrieveAPIView):\ndiff --git a/patchwork/api/user.py b/patchwork/api/user.py\nindex 2c9f71b..32fe836 100644\n--- a/patchwork/api/user.py\n+++ b/patchwork/api/user.py\n@@ -57,6 +57,7 @@ class UserList(UserMixin, ListAPIView):\n \"\"\"List users.\"\"\"\n \n search_fields = ('username', 'first_name', 'last_name', 'email')\n+ ordering_fields = ('id', 'username', 'email')\n \n \n class UserDetail(UserMixin, RetrieveUpdateAPIView):\ndiff --git a/patchwork/settings/base.py b/patchwork/settings/base.py\nindex 82fd9c2..6737350 100644\n--- a/patchwork/settings/base.py\n+++ b/patchwork/settings/base.py\n@@ -147,8 +147,10 @@ REST_FRAMEWORK = {\n 'DEFAULT_FILTER_BACKENDS': (\n 'django_filters.rest_framework.DjangoFilterBackend',\n 'rest_framework.filters.SearchFilter',\n+ 'rest_framework.filters.OrderingFilter',\n ),\n 'SEARCH_PARAM': 'q',\n+ 'ORDERING_PARAM': 'order',\n }\n \n #\n", "prefixes": [ "v2", "3/3" ] }