diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-07-01 22:49:38 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-07-01 22:49:38 +0100 |
commit | df434cd39909d177f98dec5a7575f61ea701c102 (patch) | |
tree | 3e37aee9a8ab1e4e2515170c774c4fa7f6b20514 /parsers/logbooks.py | |
parent | 8cc768e5b6398e4f3fe3211b3f8dc9712e58dd93 (diff) | |
download | troggle-df434cd39909d177f98dec5a7575f61ea701c102.tar.gz troggle-df434cd39909d177f98dec5a7575f61ea701c102.tar.bz2 troggle-df434cd39909d177f98dec5a7575f61ea701c102.zip |
SurvexBlocks now importing in deatil
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r-- | parsers/logbooks.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py index c4f2c9c..b18e839 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -114,6 +114,7 @@ def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_ expeditionday = expedition.get_expedition_day(date) lookupAttribs={'date':date, 'title':title} # 'cave' is converted to a string doing this, which renders as the cave slug. + # but it is a db query which we should try to avoid - rewrite this nonLookupAttribs={'place':place, 'text':text, 'expedition':expedition, 'cave_slug':str(cave), 'slug':slugify(title)[:50], 'entry_type':entry_type} lbo, created=save_carefully(LogbookEntry, lookupAttribs, nonLookupAttribs) @@ -356,6 +357,8 @@ def SetDatesFromLogbookEntries(expedition): Sets the date_from and date_to field for an expedition based on persontrips. Then sets the expedition date_from and date_to based on the personexpeditions. """ + # Probably a faster way to do this. This uses a lot of db queries, but we have all this + # in memory.. for personexpedition in expedition.personexpedition_set.all(): persontrips = personexpedition.persontrip_set.order_by('logbook_entry__date') # sequencing is difficult to do |