{% with object.id|stringformat:"i" as object_id %}
Create annotation:
{% get_relation_targets_from object as possible_targets %}
{% for target in possible_targets %}
{% with "rel_"|add:object_id|add:"_"|add:target.name as replace_id %}
{% with target|model_meta:"object_name" as table_suffix %}
{% get_relation_between_content_types object.content_type target as relation_types %}
{% natural_keys_by_content_types relation_types as relation_types_natural_keys %}
{% for relation in possible_relations %}
{% if relation.model_class.get_add_permission in perms %}
{% url "apis_highlighter:annotation_relation" relation as baseurlform %}
{% if target.model_class in relation.model_class.subj_list and object.content_type.model_class in relation.model_class.obj_list %}