diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-10-04 18:22:54 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-10-04 18:22:54 +0300 |
commit | bc621efc361e7fc286748ad87a1160956d832c74 (patch) | |
tree | ab0d6901900a4f054c8c2bcdc238382dd4f5f51f /parsers | |
parent | 9f4306e367517527d825aacb498eebde1e78c7b2 (diff) | |
download | troggle-bc621efc361e7fc286748ad87a1160956d832c74.tar.gz troggle-bc621efc361e7fc286748ad87a1160956d832c74.tar.bz2 troggle-bc621efc361e7fc286748ad87a1160956d832c74.zip |
wallets-per-person now finding non-survex wallets
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/people.py | 17 | ||||
-rw-r--r-- | parsers/scans.py | 2 | ||||
-rw-r--r-- | parsers/survex.py | 2 |
3 files changed, 19 insertions, 2 deletions
diff --git a/parsers/people.py b/parsers/people.py index 01998e1..0e4ca30 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -170,6 +170,20 @@ def who_is_this(year, possibleid): return None +def when_on_expo(name): + """Returns a list of PersonExpedition objects for the string, if recognised as a name + """ + person_expos = [] + expos = Expedition.objects.all() + for expo in expos: + expoers = GetPersonExpeditionNameLookup(expo) + if name in expoers: + person_expos.append(expoers[name]) + print(f"{name} => {expoers[name]}") + + return person_expos + + global foreign_friends foreign_friends = [ "Aiko", @@ -207,7 +221,8 @@ def known_foreigner(id): # Refactor. The dict GetPersonExpeditionNameLookup(expo) indexes by name and has values of personexpedition -# This is convoluted, the whole personexpedition concept is unnecessary? +# This is convoluted, the personexpedition concept is unnecessary, should it just retunr person?? +# Or better, query with a string and return a list of personexpeditions Gpersonexpeditionnamelookup = {} diff --git a/parsers/scans.py b/parsers/scans.py index 4cfb7ee..d091a3d 100644 --- a/parsers/scans.py +++ b/parsers/scans.py @@ -30,6 +30,8 @@ def load_all_scans(): It does NOT read or validate anything in the JSON data attached to each wallet. Those checks are done at runtime, when a wallet is accessed, not at import time. + + Loads people as a simple string of fullnames. We should replace this with a list of Person slugs. """ print(" - Loading Survey Scans") diff --git a/parsers/survex.py b/parsers/survex.py index 056487d..70a0962 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -153,7 +153,7 @@ def get_team_on_trip(survexblock): def get_people_on_trip(survexblock): """Gets the displayable names of the people on a survexbock trip. Only used for complete team.""" - qpeople = get_team_on_trip(survexblock) + qpeople = get_team_on_trip(survexblock) # qpeople is a Query List people = [] for p in qpeople: |