mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 18:17:06 +00:00
SurvexBlocks now importing in deatil
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user