I have created two tables in Sqlite one have the main experience data and other have the details of the data as
class experience(models.Model):
e_name = models.CharField(max_length=30)
e_post = models.CharField(max_length=50)
e_startdate = models.CharField(max_length=30)
e_enddate = models.CharField(max_length=30)
def __str__(self):
return self.e_name
class experiencedetail(models.Model):
e_name = models.ForeignKey(experience,on_delete=models.DO_NOTHING)
e_detail = models.CharField(max_length=100)
i am trying to shoe the details as shown in this image
my Html code is
{% for exp in experience %}
<div id="{{exp.e_name}}" class="tabcontent">
<h2 class="hf">{{exp.e_post}} @ <span>{{ exp.e_name }}</span></h2>
<p>{{exp.e_startdate}} - {{exp.e_enddate}}- {{exp.id}}</p>
<div class="exp-description">
<h4>
<ul style="list-style: square;">
{% for expd in exp_detail %}
{% if 'expd.e_name' == 'exp.e_name' %}
<li>{{ expd.e_detail }}</li>
{% endif %}
{% endfor %}
</ul>
</h4>
</div>
</div>
{% endfor %}
but this expd.details does not show any data. The data is present in the database.