How can I reach Django admin model stackedinlines in html tags?

I'm using stackedinline for for creating subtopic for each cancer type, in admin everything works fine, i can add subtopic for each type of cancer directly from cancer type creat/edit page, but I cant figure out how to display subtopic related to "parent" type in html template.

P.S. I'm new in programming

my models.py

from django.db import models
from ckeditor.fields import RichTextField


class CancerType(models.Model):
    name = models.CharField(max_length=200, blank=False)
    image = models.ImageField(upload_to="static/assets/images/types")
    description = RichTextField(default="", blank=True, null=True)

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = "Տեսակ"
        verbose_name_plural = "Տեսակներ"


class SubTopic(models.Model):
    type = models.ForeignKey(CancerType, on_delete=models.CASCADE)
    title = models.CharField(max_length=200, blank=False)
    topic = RichTextField(blank=False, null=True)

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = "Ենթաբաժին"
        verbose_name_plural = "Ենթաբաժիններ"


admin.py

rom django.contrib import admin
from .models import CancerType, SubTopic

admin.site.register(SubTopic)


class SubTopicInline(admin.StackedInline):
    model = SubTopic
    extra = 0


class CancerTypeAdmin(admin.ModelAdmin):
    inlines = [SubTopicInline]


admin.site.register(CancerType, CancerTypeAdmin)


type.html

{% extends 'base.html' %}
{% load static %}

{% block content %}

<img src="{% url 'home' %}{{ cancertype.image }}">
<h4>{{ cancertype.name }}</h4>
<br>
{{ cancertype.description|safe }}
<br>
{% for subtopic in object_list  %}}
    {% if subtopic.type %}}

        {{ subtopic.title }}
        <hr>
        {{ subtopic.body }}
    {% endif %}
{% endfor %}



{% endblock %}

As Jonas mentioned i had problem with my data, arriving to html. Few minutes of research gave me the answear. the for loop through the subtopics.object_set.all returns the subtopics of current cancer type. So the hmtl should be like:

{% for subtopic in object.subtopic_set.all  %}
                <div class="accordion-item">
                    <h2 class="nav-link link text-black display-4" id="{{subtopic.id}}">
                    <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{subtopic.id}}" aria-expanded="true" aria-controls="collapse{{subtopic.id}}">
                        {{ subtopic.title }}
                    </button>
                    </h2>
                    <div id="collapse{{subtopic.id}}" class="accordion-collapse collapse " aria-labelledby="heading{{subtopic.id}}" data-bs-parent="#accordionExample">
                        <div class="accordion-body">
                           <p class="nav-link link text-black display-4"> {{ subtopic.topic|safe }}</p>
                         </div>
                    </div>
                </div>
            {% endfor %}
Back to Top