]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Allow setting of values using embedded serializers
authorStephen Finucane <stephen@that.guru>
Thu, 11 Oct 2018 10:47:56 +0000 (11:47 +0100)
committerStephen Finucane <stephen@that.guru>
Sun, 14 Oct 2018 14:05:27 +0000 (15:05 +0100)
commite1ae71a9f6a33c636a4d6babca36236d8a6c29ac
treec28d9bbe7e2e43eb75c5b7b73160f798fb8008be
parent1bd87ee1c40dbae9d35ac0b5380e6dd036c60e88
REST: Allow setting of values using embedded serializers

Unfortunately, the use of embedded serializers for some fields breaks
the ability to update these fields, either via the HTML interface (where
the widget is totally busted) or via a client like 'git-pw'. What we
actually want is to be able to update these fields like normal primary
key but show them using the embedded serializer. We do just this by
using a modified variant of the PrimaryKeyRelatedField and using the
serializers simply for displaying.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #216
(cherry picked from commit 1a0021a21a8bfe822b469da7fb3e5f0ab6dcaed1)
patchwork/api/embedded.py
patchwork/tests/api/test_patch.py
releasenotes/notes/issue-216-d3bf9d1baa100f74.yaml [new file with mode: 0644]