Opened 14 years ago
Closed 14 years ago
#17190 closed Bug (fixed)
NullBooleanSelect uses ugettext, should be ugettext_lazy
| Reported by: | Raymond Penners | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | 1.3 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | yes |
Description
See django.forms.widgets:
--- widgets.py.orig 2011-11-10 10:40:05.000000000 +0100
+++ widgets.py.new 2011-11-10 10:41:05.000000000 +0100
@@ -545,7 +545,7 @@
A Select Widget intended to be used with NullBooleanField.
"""
def __init__(self, attrs=None):
- choices = ((u'1', ugettext('Unknown')), (u'2', ugettext('Yes')), (u'3', ugettext('No')))
+ choices = ((u'1', ugettext_lazy('Unknown')), (u'2', ugettext_lazy('Yes')), (u'3', ugettext_lazy('No')))
super(NullBooleanSelect, self).__init__(attrs, choices)
def render(self, name, value, attrs=None, choices=()):
Attachments (1)
Change History (5)
comment:1 by , 14 years ago
| Needs tests: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Just a quick note. This problem is happening when a widget is instantiated while a form module is loaded, e.g.:
class CommentForm(forms.Form): name = forms.CharField( widget=forms.TextInput(attrs={'class':'special'}))
Note:
See TracTickets
for help on using tickets.
Thanks for the report. This is correct. Could you provide a test case?