Hello all,
I am trying to access Dictionary values directly. Here is my view:
def unique_key_query(request, unique_key):
unique_key_object =
simpleformmodel.objects.all().filter(id=unique_key)
context = {'unique_key_object': unique_key_object}
return render(request, "bash_file_page.html", context)
Here is my template:
{% if unique_key_object %}
{% for question in unique_key_object %}
<p>{{ question.filename }}</p>
{% endfor %}
{% else %}
<p>No data is available.</p>
{% endif %}
I can access Dictionary values with a for loop, but I just do not want to
do that. How can I access the values directly?
Thank you.
--
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/b8ee9cc4-1d49-4464-b181-583042182576%40googlegroups.com.