When I use Jinja like this, it is calling all the tables and their columns. I only want to pass a particular column from the backend [duplicate]

{% for datas in data %}
                               
<option value="Hr">{{ datas.organization.org_name |slice:"15"}}</option>
{% endfor %}

When I retrieve data like this, the frontend will access all the database tables and columns. I only want to pass the org_name column.

def department(request):
data = main_collection.objects.all()

return render(request, 'department/homee.html', {'data': data})


                                     
Вернуться на верх