code: def add_parent(sender, instance, **kwargs):
      
      if not kwargs['created']:
          return
      for att in ['task', 'context']:
          parent = getattr(instance, att).item_id
          child = instance.item_id
          ItemRelation.objects.get_or_create(
              parent_id=parent,
              child_id=child,
              visible=True,
          )
docs: When a task instance is created, create also an item relation.