Your view seems to have incorrect render.

Sent from Yahoo Mail on Android 
 
  On Thu, 7 May 2020 at 11:25, Mohsen Pahlevanzadeh<[email protected]> 
wrote:   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,
      }
    return HttpResponse(template.render(context))
#########################################
And the following template:
########################################
{% if latest_question_list %}

          salaam
          <a href="/posts/{{ question.id }}/">{{ latest_question_list }}</a>
 {% endif %}
###########################################

I see the following result in my browser:
#############################################

salaam
<QuerySet [<User: m_pahlevanzadeh>]>


##########################################

How Can I some field in my Queryset in template?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJFFGZLhqwkvNVbHtGoU2zG5HdNjy-xbL7NbSTWJxfN0tnaZKQ%40mail.gmail.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1903469156.1738920.1588832205464%40mail.yahoo.com.

Reply via email to