Answer the question
In order to leave comments, you need to log in
Django. Working with data from the database and displaying it in a template?
Hello.
I ask you to reason with an unreasonable newbie in django and python.
The crux of the matter is as follows.
There is a hypothetical query that is processed in the MySQL DBMS:
The text of the same query is included in the view: The
returned data is embedded in the template:
When I open the page, I get an escape sequence and I don’t understand what to do with this result set in the future
From reading books, to the current moment in time, there is no positive, because in the head now from the received dose of information is porridge and it takes some time to rethink what has been read and line up all the material on the shelves.
I ask you to give recommendations on how to switch from Unicode strings to a normal human-oriented display and how it is possible to access only the field with the name or the field with the number from this result set.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
There is information that the row variable is a tuple.
Try
{{ row.NameDocumentFull }}
<br>
{{ row.QDNumSerial }}
You are typing dict. And there is nothing surprising about what is printed in ascii. If you output separate lines, they will be decoded in utf.
And to access the list index in django templates use "."
In principle, everything has already been painted above.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question