get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/710292/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 710292,
    "url": "http://patchwork.ozlabs.org/api/patches/710292/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/patchwork/patch/20170102212347.18089-2-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-2-stephen@that.guru>",
    "list_archive_url": null,
    "date": "2017-01-02T21:23:46",
    "name": "[v2,2/3] REST: Integrate searching",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1209ce97ebfec5f067b1ec561266ce8c52d85da2",
    "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-2-stephen@that.guru/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/710292/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/710292/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 [103.22.144.68])\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 3tsqpS3lb9z9sf9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  3 Jan 2017 08:24:32 +1100 (AEDT)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3tsqpS2McszDqFS\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  3 Jan 2017 08:24:32 +1100 (AEDT)",
            "from butterfly.maple.relay.mailchannels.net\n\t(butterfly.maple.relay.mailchannels.net [23.83.214.27])\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 3tsqny1Xm3zDqDx\n\tfor <patchwork@lists.ozlabs.org>;\n\tTue,  3 Jan 2017 08:24:05 +1100 (AEDT)",
            "from relay.mailchannels.net (localhost [127.0.0.1])\n\tby relay.mailchannels.net (Postfix) with ESMTP id 9253E1BC1B1;\n\tMon,  2 Jan 2017 21:24:02 +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 F15C81BCA8F;\n\tMon,  2 Jan 2017 21:24:01 +0000 (UTC)",
            "from one.mxroute.com ([TEMPUNAVAIL]. [10.24.23.24])\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:24:02 +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=\"n8kTkGD3\"; 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=\"n8kTkGD3\"; 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=\"n8kTkGD3\"; 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": "1483392242335:3939560186",
        "X-MC-Ingress-Time": "1483392242335",
        "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=s+f4wHXg+UfDjLjw5tZl0cRfB9Qpy2IQK5Mbh6z78Cg=;\n\tb=n8kTkGD3IVjsBCJyfSwt9aKrFE\n\t575qYaNW2dglhdjMwlQTumRoTjvuncIHCZ6VpfYX+piEMxBG5Gn+q36RabW4ghv0wE60jKOQKYS+5\n\tdfkzim73aaZwsR+0cX5bOQY2MovquPRUqneTREGtGobF0gP2xYXcYTPrncYN0cLhRXmRNEt46g8HT\n\t7DDVP7U+3Qhg7FA2MhpVplXqMLiWQ4oMDqnjJxfPqcAdIORKe9yPXORDksapVy1Jm0wMRHSj4YZrB\n\t0S3dHsOg1JU8Pda9EkwY+nP86XZ+sT5FgyFUlsc4z2+1pgQx4ZkqSp3lCtpOsUdV4YdVUGublGFqR\n\tXdaKJ5jQ==;",
        "From": "Stephen Finucane <stephen@that.guru>",
        "To": "patchwork@lists.ozlabs.org",
        "Subject": "[PATCH v2 2/3] REST: Integrate searching",
        "Date": "Mon,  2 Jan 2017 21:23:46 +0000",
        "Message-Id": "<20170102212347.18089-2-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": "Search by way of the 'q' 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     | 1 +\n patchwork/api/person.py    | 2 +-\n patchwork/api/project.py   | 3 ++-\n patchwork/api/series.py    | 1 +\n patchwork/api/user.py      | 2 +-\n patchwork/settings/base.py | 2 ++\n 7 files changed, 9 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/patchwork/api/cover.py b/patchwork/api/cover.py\nindex 6374ce9..0b6b546 100644\n--- a/patchwork/api/cover.py\n+++ b/patchwork/api/cover.py\n@@ -68,6 +68,7 @@ class CoverLetterList(ListAPIView):\n \n     serializer_class = CoverLetterListSerializer\n     filter_class = CoverLetterFilter\n+    search_fields = ('name',)\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 d12464f..fc5a0ee 100644\n--- a/patchwork/api/patch.py\n+++ b/patchwork/api/patch.py\n@@ -119,6 +119,7 @@ class PatchList(ListAPIView):\n     permission_classes = (PatchworkPermission,)\n     serializer_class = PatchListSerializer\n     filter_class = PatchFilter\n+    search_fields = ('name',)\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 2c1ca15..10cf781 100644\n--- a/patchwork/api/person.py\n+++ b/patchwork/api/person.py\n@@ -46,7 +46,7 @@ class PersonMixin(object):\n class PersonList(PersonMixin, ListAPIView):\n     \"\"\"List users.\"\"\"\n \n-    pass\n+    search_fields = ('name', 'email')\n \n \n class PersonDetail(PersonMixin, RetrieveAPIView):\ndiff --git a/patchwork/api/project.py b/patchwork/api/project.py\nindex 3cc2c32..8901ab4 100644\n--- a/patchwork/api/project.py\n+++ b/patchwork/api/project.py\n@@ -74,7 +74,8 @@ class ProjectMixin(object):\n class ProjectList(ProjectMixin, ListAPIView):\n     \"\"\"List projects.\"\"\"\n \n-    pass\n+    search_fields = ('link_name', 'list_id', 'list_email', 'web_url',\n+                     'scm_url', 'webscm_url')\n \n \n class ProjectDetail(ProjectMixin, RetrieveUpdateAPIView):\ndiff --git a/patchwork/api/series.py b/patchwork/api/series.py\nindex edde9a9..996094b 100644\n--- a/patchwork/api/series.py\n+++ b/patchwork/api/series.py\n@@ -56,6 +56,7 @@ class SeriesList(SeriesMixin, ListAPIView):\n     \"\"\"List series.\"\"\"\n \n     filter_class = SeriesFilter\n+    search_fields = ('name',)\n \n \n class SeriesDetail(SeriesMixin, RetrieveAPIView):\ndiff --git a/patchwork/api/user.py b/patchwork/api/user.py\nindex 2153cc9..2c9f71b 100644\n--- a/patchwork/api/user.py\n+++ b/patchwork/api/user.py\n@@ -56,7 +56,7 @@ class UserMixin(object):\n class UserList(UserMixin, ListAPIView):\n     \"\"\"List users.\"\"\"\n \n-    pass\n+    search_fields = ('username', 'first_name', 'last_name', 'email')\n \n \n class UserDetail(UserMixin, RetrieveUpdateAPIView):\ndiff --git a/patchwork/settings/base.py b/patchwork/settings/base.py\nindex 35b85c7..82fd9c2 100644\n--- a/patchwork/settings/base.py\n+++ b/patchwork/settings/base.py\n@@ -146,7 +146,9 @@ REST_FRAMEWORK = {\n     'DEFAULT_PAGINATION_CLASS': 'patchwork.api.base.LinkHeaderPagination',\n     'DEFAULT_FILTER_BACKENDS': (\n         'django_filters.rest_framework.DjangoFilterBackend',\n+        'rest_framework.filters.SearchFilter',\n     ),\n+    'SEARCH_PARAM': 'q',\n }\n \n #\n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}