2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-18 09:27:16 +00:00

Rename lookupAttribs and nonLookupAttribs + add slug to Person

This commit is contained in:
2023-10-01 12:42:47 +03:00
parent fd94909ee7
commit 16d3ee9f92
7 changed files with 42 additions and 39 deletions

View File

@@ -77,7 +77,7 @@ def store_edited_entry_into_database(date, place, title, text, others, author, t
DataIssue.objects.create(parser="logbooks", message=message)
slug = slug + "_" + unique_slug(text,2)
nonLookupAttribs = {
otherAttribs = {
"place": place,
"text": text,
"expedition": expedition,
@@ -86,9 +86,9 @@ def store_edited_entry_into_database(date, place, title, text, others, author, t
"title": f"{place} - {title}",
# "other_people": others
}
lookupAttribs = {"slug": slug, "date": date }
coUniqueAttribs = {"slug": slug, "date": date }
lbo = LogbookEntry.objects.create(**nonLookupAttribs, **lookupAttribs)
lbo = LogbookEntry.objects.create(**otherAttribs, **coUniqueAttribs)
pt_list = []
# These entities have to be PersonExpedition objects
@@ -116,9 +116,9 @@ def store_edited_entry_into_database(date, place, title, text, others, author, t
print(message)
DataIssue.objects.create(parser="logbooks", message=message)
else:
lookupAttribs = {"personexpedition": personyear, "nickname_used": name, "logbook_entry": lbo} # lbo is primary key
nonLookupAttribs = {"time_underground": tu, "is_logbook_entry_author": (name==author)}
pt_list.append(PersonLogEntry(**nonLookupAttribs, **lookupAttribs))
coUniqueAttribs = {"personexpedition": personyear, "nickname_used": name, "logbook_entry": lbo} # lbo is primary key
otherAttribs = {"time_underground": tu, "is_logbook_entry_author": (name==author)}
pt_list.append(PersonLogEntry(**otherAttribs, **coUniqueAttribs))
except:
# This should not happen. We do not raise exceptions in that function