0
沒有顯示出來這段代碼是模板HTML:外鍵具有價值,但做模板
<table border="1">
<thead>
<tr>
<th>1</th>
<th>1</th>
<th>1</th>
<th>1</th>
<th>1</th>
<th>1</th>
</tr>
</thead>
<tbody>
{% for row in hosts %}
<tr>
<td>{{row.nid}}</td>
<td>{{row.hostname}}</td>
<td>{{row.ip}}</td>
<td>{{row.port}}</td>
<td>{{row.bussiness_ip}}</td>
<td>{{row.bussiness.caption}}</td>
</tr>
{% endfor %}
</tbody>
</table>
bussiness_ip
是主表的外鍵,並在sqlite3的它的價值:
但row.bussiness_ip
沒有顯示出來,也沒有在瀏覽器中row.bussiness.ip
:
我走錯誤。 – 244boy