]> 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:03:34 +0000 (15:03 +0100)
commit1a0021a21a8bfe822b469da7fb3e5f0ab6dcaed1
treeb4ed17762aad7b2ccf838789ab2d087a2924f469
parentb690746d3f21fac69dc6f2aadd81bdd38ace225a
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
patchwork/api/embedded.py
patchwork/tests/api/test_patch.py
releasenotes/notes/issue-216-d3bf9d1baa100f74.yaml [new file with mode: 0644]