@@ -85,6 +85,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer):
mbox = SerializerMethodField()
series = SeriesSerializer(read_only=True)
comments = SerializerMethodField()
+ notes = SerializerMethodField()
check = SerializerMethodField()
checks = SerializerMethodField()
tags = SerializerMethodField()
@@ -108,6 +109,11 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer):
reverse('api-patch-comment-list', kwargs={'patch_id': patch.id})
)
+ def get_notes(self, patch):
+ return self.context.get('request').build_absolute_uri(
+ reverse('api-patch-note-list', kwargs={'patch_id': patch.id})
+ )
+
def get_check(self, instance):
return instance.combined_check_state
@@ -173,6 +179,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer):
'mbox',
'series',
'comments',
+ 'notes',
'check',
'checks',
'tags',
@@ -191,6 +198,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer):
'mbox',
'series',
'comments',
+ 'notes',
'check',
'checks',
'tags',
Patch serializer returns a fields containing it's notes. Some notes may be filtered out depending on the request's user and on the note maintainer_only attribute Signed-off-by: andrepapoti <andrepapoti@gmail.com> --- patchwork/api/patch.py | 8 ++++++++ 1 file changed, 8 insertions(+)