Regression? evaluation of a lazy string in Template
52 views
Skip to first unread message
Dražen Odobašić
unread,
Jul 30, 2018, 4:59:51 AM7/30/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
Hi,
we are using Template engine to convert some translatable textual class level
attributes, like [0]. In the process of migration to Django2.0, we got a problem
with template Lexer which raises a `TypeError: expected string or bytes-like
object` [1]
I'm not sure if are just misusing the template system to do something what it
wasn't designed for, or if this is a regression from Django 1.11. Previously
Django was using `force_text` to force evaluation of a lazy string [2] and Lexer
always got a text object.
We could force the evaluation of the lazy strings in the application, but I was
wandering if this is a regression, and should actually be fixed in Django?