[PATCH 02/10] models: Add 'Series' model and related models

Andrew Donnellan andrew.donnellan at au1.ibm.com
Tue Jul 19 12:56:40 AEST 2016


On 19/07/16 10:50, Russell Currey wrote:
> On Mon, 2016-06-13 at 11:41 +0100, Stephen Finucane wrote:
>> Add a series model. This model is intentionally very minimal to allow
>> as much dynaminism as possible. It is expected that patches will be
>> migrated between series as new data is provided.
>>
>> Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
>> ---
>
> I'm pretty sure this broke the patches API, though I'm not exactly a Django
> expert.  Here's what I'm seeing:
>
> Exception Type: ImproperlyConfigured at /api/1.0/patches/
> Exception Value: Could not resolve URL for hyperlinked relationship using view
> name "seriesrevision-detail". You may have failed to include the related model
> in your API, or incorrectly configured the `lookup_field` attribute on this
> field.
>
> Full log here: http://dpaste.com/0P3C63K

Temporary fix to exclude the series field from the Patch endpoint.

Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

diff --git a/patchwork/rest_serializers.py b/patchwork/rest_serializers.py
index af6b1b7..be55ad1 100644
--- a/patchwork/rest_serializers.py
+++ b/patchwork/rest_serializers.py
@@ -84,7 +84,7 @@ class PatchSerializer(URLSerializer):
                              'content', 'hash', 'msgid')
          # there's no need to expose an entire "tags" endpoint, so we 
custom
          # render this field
-        exclude = ('tags',)
+        exclude = ('tags', 'series')
      check_names = dict(Check.STATE_CHOICES)
      mbox_url = SerializerMethodField()
      state = SerializerMethodField()


-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Patchwork mailing list