forked from expo/troggle
bugfix and docum
This commit is contained in:
parent
1589188988
commit
3617f9b6d9
@ -24,7 +24,7 @@ from django.template import Context, loader
|
|||||||
|
|
||||||
'''This file declares TROG a globally visible object for caches.
|
'''This file declares TROG a globally visible object for caches.
|
||||||
|
|
||||||
TROG is a dictionary holding gloablly visible indexes and cache functions.
|
TROG is a dictionary holding globally visible indexes and cache functions.
|
||||||
It is a Global Object, see https://python-patterns.guide/python/module-globals/
|
It is a Global Object, see https://python-patterns.guide/python/module-globals/
|
||||||
troggle.utils.TROG
|
troggle.utils.TROG
|
||||||
|
|
||||||
|
@ -52,9 +52,6 @@ def expedition(request, expeditionname):
|
|||||||
'''Returns a rendered page for one expedition, specified by the year e.g. '2019'.
|
'''Returns a rendered page for one expedition, specified by the year e.g. '2019'.
|
||||||
If page caching is enabled, it caches the dictionaries used to render the template page.
|
If page caching is enabled, it caches the dictionaries used to render the template page.
|
||||||
|
|
||||||
The cache is refreshed if '?reload' is present in the requesting URL, which also re-parses the logbook.
|
|
||||||
By specifying a '0' for the expected number of entries in the logbook cache, this forces the parser to
|
|
||||||
re-parse the original logbook HTML file.
|
|
||||||
'''
|
'''
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
if "reload" in request.GET:
|
if "reload" in request.GET:
|
||||||
@ -68,7 +65,7 @@ def expedition(request, expeditionname):
|
|||||||
entry.delete()
|
entry.delete()
|
||||||
entries = this_expedition.logbookentry_set.all()
|
entries = this_expedition.logbookentry_set.all()
|
||||||
print(f'! - expo {expeditionname} {len(entries)} entries after deletion')
|
print(f'! - expo {expeditionname} {len(entries)} entries after deletion')
|
||||||
LoadLogbookForExpedition(this_expedition, 0) # 0 means re-parse as implies cache expected to be 0
|
LoadLogbookForExpedition(this_expedition)
|
||||||
logged_in = True
|
logged_in = True
|
||||||
else:
|
else:
|
||||||
logged_in = False
|
logged_in = False
|
||||||
|
@ -32,20 +32,19 @@ todo='''
|
|||||||
|
|
||||||
-- far too many uses of Django field dereferencing to get values, which is SLOW
|
-- far too many uses of Django field dereferencing to get values, which is SLOW
|
||||||
|
|
||||||
|
|
||||||
- Loogbooks 1987, 1988, 1989 all crash on MySql - but not sqlite - with db constraint fail. Edit logbook to fix.
|
- Loogbooks 1987, 1988, 1989 all crash on MySql - but not sqlite - with db constraint fail. Edit logbook to fix.
|
||||||
|
|
||||||
- import/parse/re-export-as-html the 'artisanal-format' old logbooks so that
|
- import/parse/re-export-as-html the 'artisanal-format' old logbooks so that
|
||||||
we keep only a modern HTML05 format. Then we can retiure the old parsers and reduce the
|
we keep only a modern HTML05 format. Then we can retiure the old parsers and reduce the
|
||||||
volume of code here substantially.
|
volume of code here substantially.
|
||||||
|
|
||||||
- edit LoadLogbooks() to use coroutines to speed up import substantially,
|
|
||||||
but perhaps we had better profile it first?
|
|
||||||
|
|
||||||
- rewrite to use generators rather than storing everything intermediate in lists - to reduce memory impact.
|
- rewrite to use generators rather than storing everything intermediate in lists - to reduce memory impact.
|
||||||
|
|
||||||
- the object store will need additional functions to replicate the persontrip calculation
|
- the object store will need additional functions to replicate the persontrip calculation
|
||||||
and storage. For the moment we leave all that to be done in the django db
|
and storage. For the moment we leave all that to be done in the django db
|
||||||
|
Concurrent synchronisation would be nice..
|
||||||
|
|
||||||
|
- DB lock currently prevents multiple threads for loading logbooks. But asyncio might work..?
|
||||||
|
|
||||||
- We should ensure logbook.html is utf-8 and stop this crap:
|
- We should ensure logbook.html is utf-8 and stop this crap:
|
||||||
file_in = open(logbookfile,'rb')
|
file_in = open(logbookfile,'rb')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user