rel = db.CIRelation.objects.get(
    parent_id=ci1.id,
    child_id=ci2.id,
....