I taking register# and name to search the database result, able to see the other field which is within the table, other fields are showing but not showing the above mention field data. I have already entered in the admin panel. Help Appreciated? I have created the models.py with the following value but unable to display it in the frontend.
subject1_title=models.CharField(max_length=40)
subject1_credit_hour=models.TextField()
subject1_grade_point=models.TextField()
subject1_grade=models.TextField()
subject1_remarks=models.CharField(max_length=20, null=True, blank=True)
my home.html page looks like this.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
th,
td {
border: 2px solid #666;
}
table.t1 {
table-layout: fixed;
width: 40%;
}
</style>
</head>
<h1><center>Search Your Result</center></h1>
<br>
<form method="POST" action=" " align="center">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit"/>
<br>
<br>
<br>
{% for result_query in objects %}
<table align="center">
<tr>
<th>S.N</th>
<th>Course Code No.</th>
<th>Course Title</th>
<th>Cr.Hr.</th>
<th>Grade Point</th>
<th>Grade</th>
<th>Remarks</th>
</tr>
<tr>
<td>{{ result_query.subject1_code }}</td>
<td>{{ result_query.subject1_title }}</td>
<td>{{ result_query.subject1_credit_hour }}</td>
<td>{{result.query.subject1_grade_point}}</td>
<td>{{result.query.subject1_grade}}</td>
<td>{{result.query.subject1_remarks}}</td>
</tr>
<tr>
<td>{{ result_query.subject2_code }}</td>
<td>{{ result_query.subject2_title }}</td>
<td>{{ result_query.subject2_credit_hour }}</td>
<td>{{result.query.subject2_grade_point}}</td>
<td>{{result.query.subject2_grade}}</td>
<td>{{result.query.subject2_remarks}}</td>
</tr>
<tr>
<td>{{ result_query.subject3_code }}</td>
<td>{{ result_query.subject3_title }}</td>
<td>{{ result_query.subject3_credit_hour }}</td>
<td>{{result.query.subject3_grade_point}}</td>
<td>{{result.query.subject3_grade}}</td>
<td>{{result.query.subject3_remarks}}</td>
</tr>
<tr>
<td>{{ result_query.subject4_code }}</td>
<td>{{ result_query.subject4_title }}</td>
<td>{{ result_query.subject4_credit_hour }}</td>
<td>{{result.query.subject4_grade_point}}</td>
<td>{{result.query.subject4_grade}}</td>
<td>{{result.query.subject4_remarks}}</td>
</tr>
<tr>
<td>{{ result_query.subject5_code }}</td>
<td>{{ result_query.subject5_title }}</td>
<td>{{ result_query.subject5_credit_hour }}</td>
<td>{{result.query.subject5_grade_point}}</td>
<td>{{result.query.subject5_grade}}</td>
<td>{{result.query.subject5_remarks}}</td>
</tr>
<tr>
<td>{{ result_query.subject6_code }}</td>
<td>{{ result_query.subject6_title }}</td>
<td>{{ result_query.subject6_credit_hour }}</td>
<td>{{result.query.subject6_grade_point}}</td>
<td>{{result.query.subject6_grade}}</td>
<td>{{result.query.subject6_remarks}}</td>
</tr>
</table>
{% endfor %}
</form>
</html>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…