diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-07-05 14:14:03 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-07-05 14:14:03 +0300 |
commit | a11541eb58df7336e54b98b6292b7db50369b0f4 (patch) | |
tree | aa465e2478021e72de2bf7b336d1ac73624e1bf0 /core/views/scans.py | |
parent | dbe6d10fff393661002fb576dacb8223af8a5899 (diff) | |
download | troggle-a11541eb58df7336e54b98b6292b7db50369b0f4.tar.gz troggle-a11541eb58df7336e54b98b6292b7db50369b0f4.tar.bz2 troggle-a11541eb58df7336e54b98b6292b7db50369b0f4.zip |
prefetch_related initial attempts
Diffstat (limited to 'core/views/scans.py')
-rw-r--r-- | core/views/scans.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/views/scans.py b/core/views/scans.py index 4b35377..097c69f 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -58,5 +58,11 @@ def scansingle(request, path, file): def allwallets(request): + '''Returns all the wallets in the system, we would like to use + the Django queryset SQL optimisation https://docs.djangoproject.com/en/3.2/ref/models/querysets/#prefetch-related + to get the related singlescan and survexblock objects but that requires rewriting this to do the query on those, not on + the wallets + ''' manywallets = Wallet.objects.all() + # manywallets = Wallet.objects.all().prefetch_related('singlescan') fails as the link is defined on 'singlescan' not on 'wallet' return render(request, 'manywallets.html', { 'manywallets':manywallets, 'settings': settings }) |