docs: def get_ties_for_categories_qs(cls, categories, user=None, status=None):
          """Returns a QuerySet of Ties for the given categories.
  
          :param list|Category categories:
          :param User|None user:
          :param int|None status:
          :return:
          """
          if not isinstance(categories, list):
              categories = [categories]
  
          category_ids = []
          for category in categories:
              if isinstance(category, models.Model):
                  category_ids.append(category.id)
              else:
                  category_ids.append(category)
          filter_kwargs = {
              'content_type': ContentType.objects.get_for_model(cls, for_concrete_model=False),
              'category_id__in': category_ids
          }
          if user is not None:
              filter_kwargs['creator'] = user
          if status is not None:
              filter_kwargs['status'] = status
          ties = get_tie_model().objects.filter(**filter_kwargs)
          return ties