'Why does backtick string conversion work sporadically in my Django application?
I am writing a Django application, and I often use the Python backtick operator to convert integers to strings.
Recently, I found that a form in my application was broken. After rewriting several backticks into str(), the application was fixed.
Specifically, where course is an object, I changed
``course.id \
into str(course.id)
to fix the application.
When does the backtick operator work, and when does it not?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|