From 1232c8507be24fbabf38eee7838a58a65c7d762b Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Fri, 10 Nov 2023 11:58:32 +0000 Subject: [PATCH] docs: remove a couple more todos --- dataimporter/links.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dataimporter/links.py b/dataimporter/links.py index 9772fa1..0e57b1c 100644 --- a/dataimporter/links.py +++ b/dataimporter/links.py @@ -50,11 +50,10 @@ def transform(self, base_record: SourceRecord, data: dict): media = self.get_foreign_record_data(base_record) if media: existing_media = data.get(MediaLink.MEDIA_TARGET_FIELD, []) - # TODO: could we order in a more useful way, e.g. category? + # order by media ID data[MediaLink.MEDIA_TARGET_FIELD] = sorted( chain(existing_media, media), key=itemgetter("_id") ) - # TODO: integer? data[MediaLink.MEDIA_COUNT_TARGET_FIELD] = len(existing_media) + len(media)