]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Use SerializerMethod field
authorStephen Finucane <stephen@that.guru>
Wed, 23 Nov 2016 19:35:40 +0000 (19:35 +0000)
committerStephen Finucane <stephen@that.guru>
Fri, 23 Dec 2016 23:37:23 +0000 (23:37 +0000)
commitc3df793243b3f911e5d0d6b9c55acaf79a9fe918
tree2b14a4c5baebcf532a27eaa4e02eb5250529a881
parentd4939247040d07d8b63e3fe65207ee6e3f509c60
REST: Use SerializerMethod field

Use 'SerializerMethodField' to override how we generate fields, rather
than hacking the 'to_representation' method. This is the more idiomatic
way to do this.

The Meta class for the Project and Patch serializers are moved to the
bottom of the serializers and some variables renamed, both for
consistency's sake.

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/api/patch.py
patchwork/api/project.py