diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-10-01 12:42:47 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-10-01 12:42:47 +0300 |
commit | 16d3ee9f92914859edd7b568c9dbd802fd93438e (patch) | |
tree | 97c07107398f8da09ce5827b1c486a1d7a62a143 /parsers/people.py | |
parent | fd94909ee7e53a4e1defb8202055ac7c211abb1e (diff) | |
download | troggle-16d3ee9f92914859edd7b568c9dbd802fd93438e.tar.gz troggle-16d3ee9f92914859edd7b568c9dbd802fd93438e.tar.bz2 troggle-16d3ee9f92914859edd7b568c9dbd802fd93438e.zip |
Rename lookupAttribs and nonLookupAttribs + add slug to Person
Diffstat (limited to 'parsers/people.py')
-rw-r--r-- | parsers/people.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/parsers/people.py b/parsers/people.py index ef6984b..4799ebf 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -78,15 +78,16 @@ def load_people_expos(): if nexpos <= 0: print(" - Creating expeditions") for year in years: - lookupAttribs = {"year": year} - nonLookupAttribs = {"name": f"CUCC expo {year}"} - e = Expedition.objects.create(**nonLookupAttribs, **lookupAttribs) + coUniqueAttribs = {"year": year} + otherAttribs = {"name": f"CUCC expo {year}"} + e = Expedition.objects.create(**otherAttribs, **coUniqueAttribs) print(" - Loading personexpeditions") for personline in personreader: name = personline[header["Name"]] name = re.sub(r"<.*?>", "", name) + slug = slugify(name) firstname = "" nick = "" @@ -111,9 +112,9 @@ def load_people_expos(): else: vfho = True - lookupAttribs = {"first_name": firstname, "last_name": (lastname or "")} - nonLookupAttribs = {"is_vfho": vfho, "fullname": fullname, "nickname": nick} - person = Person.objects.create(**nonLookupAttribs, **lookupAttribs) + coUniqueAttribs = {"first_name": firstname, "last_name": (lastname or "")} + otherAttribs = {"is_vfho": vfho, "fullname": fullname, "nickname": nick} + person = Person.objects.create(**otherAttribs, **coUniqueAttribs) parse_blurb(personline=personline, header=header, person=person) @@ -121,9 +122,9 @@ def load_people_expos(): for year, attended in list(zip(headers, personline))[5:]: expedition = Expedition.objects.get(year=year) if attended == "1" or attended == "-1": - lookupAttribs = {"person": person, "expedition": expedition} - nonLookupAttribs = {"is_guest": (personline[header["Guest"]] == "1")} - pe = PersonExpedition.objects.create(**nonLookupAttribs, **lookupAttribs) + coUniqueAttribs = {"person": person, "expedition": expedition} + otherAttribs = {"is_guest": (personline[header["Guest"]] == "1")} + pe = PersonExpedition.objects.create(**otherAttribs, **coUniqueAttribs) print("", flush=True) |