Skip to content

Commit

Permalink
Add note to tricky code
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpg committed Jun 2, 2024
1 parent e203e07 commit 5ba5934
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions taggit/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ def _to_tag_model_instances(self, tags, tag_kwargs):
# tags can be instances of our through models, or strings

tag_strs = [tag for tag in tags if isinstance(tag, str)]
# This map from tag names to tags lets us handle deduplication
# without doing extra queries along the way, all while relying on
# data we were going to pull out of the database anyways
# existing_tags_for_str[tag_name] = tag
existing_tags_for_str = {}
# we are going to first try and lookup existing tags (in a single query)
if case_insensitive:
Expand Down

0 comments on commit 5ba5934

Please sign in to comment.