Re: How to send dict to template and use it

2020-05-07 Thread Andréas Kühne
Hi, If you want to see something in the queryset you need to query it :) For example: {% for question in latest_question_list %} {{question.id }}{%endfor%} Or you can take the last or first item? {{ latest_question_list.first.id }} Regards, Andréas Den tors 7 maj 2020 kl 07:55 skrev Mohse

Re: How to send dict to template and use it

2020-05-06 Thread 'Amitesh Sahay' via Django users
Your view seems to have incorrect render. Sent from Yahoo Mail on Android On Thu, 7 May 2020 at 11:25, Mohsen Pahlevanzadeh wrote: I have the following view function: def index(request, question_id):     latest_question_list = User.objects.all() #Post.objec

How to send dict to template and use it

2020-05-06 Thread Mohsen Pahlevanzadeh
I have the following view function: def index(request, question_id): latest_question_list = User.objects.all() #Post.objects.all() template = loader.get_template('posts/index.html') context = { 'latest_question_list': latest_question_list,