

@require_instance_manager
def add(self, *tags):
    str_tags = set([t for t in tags if (not isinstance(t, self.through.tag_model()))])
    tag_objs = (set(tags) - str_tags)
    if str_tags:
        q = models.Q()
        for str_tag in str_tags:
            q |= models.Q(name__iexact=str_tag)
        existing = self.through.tag_model().objects.filter(q)
        tag_objs.update(existing)
        existing_low = [t.name.lower() for t in existing]
        new_tags = [t for t in str_tags if (t.lower() not in existing_low)]
        for new_tag in new_tags:
            self.add(self.through.tag_model().objects.create(name=new_tag))
    for tag in tag_objs:
        self.through.objects.get_or_create(tag=tag, **self._lookup_kwargs())

dataset/ETHPy150Open lmorchard/badg.us/vendor-local/lib/python/taggit/managers.py _TaggableManager.add/VarMisuse@156/199 `tag_objs`->`self`