]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Correct some prefetch, select_related
authorStephen Finucane <stephen@that.guru>
Mon, 15 May 2017 23:13:27 +0000 (00:13 +0100)
committerStephen Finucane <stephen@that.guru>
Thu, 18 May 2017 20:18:37 +0000 (21:18 +0100)
commit2d486c28c5b8a67c7242f19749354afd21533961
treeb01eaa3f76ed8da15a1fad6c6130cf70a671951d
parent9db5cd0b9f29e0526656897793daed3c7b502b2f
REST: Correct some prefetch, select_related

There were two issues here:

- The 'get_queryset' function, rather than the 'queryset' attribute,
  must be overriden when using either the 'prefetch_related' or
  'select_related' functions

- A couple of endpoints contained a 'project' attribute, but this wasn't
  being prefetched. This didn't cause issues in a single-project
  deployment, as used in testing, but will for larger deployments

Resolve both issues.

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