I want to print out only those variables from the User Model below and show them to the user, so could you tell me what to do?
{% for users in object_list %}
<li class="user">{{ user }}</li>
{% {% endfor %}
Wouldn't this bring all the information?
#django
object_list = [[user1,id,etc],[user2,id,etc],[user3,id,etc]] #[username,id,etc]
return render(......, {"object_list":object_list}
<!-- jinja2 template -->
<table>
<tr>
<th>username</th>
<th>userid</th>
<th>etc</th>
</tr>
{% {% for user in object_list %}
<tr>
<td>{{user[0]}}</td>
<td>{{user[1]}}</td>
<td>{{user[2]}}</td>
</tr>
{% {% endfor %}
</table>
585 PHP ssh2_scp_send fails to send files as intended
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
624 Uncaught (inpromise) Error on Electron: An object could not be cloned
615 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.