models.py
{{{
# _ is ugettext_lazy
class MyModel(models.Model):
name = models.CharField(_('My label'))
}}}
forms.py
{{{
class MyForm(forms.ModelForm):
class Meta:
model = MyModel
}}}
views.py
{{{
def my_view(request):
myform = MyForm()
assert False, myform['name'].label_tag()
}}}
If "My label" is translated as "My 'label'" (with single quotes around
it), here's what you get:
`<label>My &#39;label&#39;</label>`
The expected behaviour would be to get the contents escaped but only once:
`<label>My 'label'</label>`
That would then appear correctly in the template. Also if you use a simple
string as a label in your model, it gets escaped correctly.
--
Ticket URL: <https://code.djangoproject.com/ticket/20778>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0
Comment:
I can't reproduce this on master or 1.5.x. Perhaps you could provide a
test case for Django's test suite that demonstrates the problem?
--
Ticket URL: <https://code.djangoproject.com/ticket/20778#comment:1>