From 2bc240b1beae9759ba377103bc3f11bbcc693c72 Mon Sep 17 00:00:00 2001 From: Xander Vertegaal Date: Fri, 23 Aug 2024 18:08:09 +0200 Subject: [PATCH] Use tuple key --- backend/aethel_db/views/list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/aethel_db/views/list.py b/backend/aethel_db/views/list.py index 1fef88e..ba7a6c7 100644 --- a/backend/aethel_db/views/list.py +++ b/backend/aethel_db/views/list.py @@ -60,8 +60,8 @@ def get_or_create_result( new_phrase = AethelListPhrase(items=items) # Construct a unique 'key' for every combination of word, lemma and type, so we can group samples. - key_word = " ".join([item.word for item in phrase.items]) - key_lemma = " ".join([item.lemma for item in phrase.items]) + key_word = tuple(item.word for item in phrase.items) + key_lemma = tuple(item.lemma for item in phrase.items) key = (key_word, key_lemma, type) new_result = AethelListResult(phrase=new_phrase, type=type, sampleCount=0)