i have a table showing data from the database but i need it to show the most recent first
Table if u see the picture there is in "monto" a 0.03 thats shown like the last one but it is the most recent in the database, i need the table to show the most recent activity first
Views.py
def index(request):
monto = Transacciones.objects.filter(owner = request.user)
paginator = Paginator(monto , 7)
page_number = request.GET.get('pagina')
page_obj= Paginator.get_page(paginator,page_number)
context = {
'page_obj': page_obj ,
}
return render(request, 'Admin/Index.cshtml',context)
table html
<div class="">
<div class="">
<table class="table h1color bgcolorwhite">
<thead>
<tr>
<th>FECHA</th>
<th>MONTO</th>
<th>TIPO</th>
<th>MONTO COMPRADO BTC</th>
<th>MONTO RETIRADO CLP</th>
<th>ESTADO</th>
</tr>
</thead>
<tbody>
{% for a in page_obj %}
<tr>
<td style="">{{a.date}}</td>
<td style="font-weight:bold;">{{a.amount}}</td>
<td style="text-align:left">{{a.tipo_transaccion}}</td>
<td style="font-weight:bold;">{{a.monto_comprado_btc}}</td>
<td style="font-weight:bold;">{{a.monto_retirado_clp}}</td>
<td style="">{{a.status}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
srry if my english was bad... Thanks a lot!!