Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7927 closed (worksforme)

Form Field not rendered

Reported by: Oliver Weichhold <oliver@…> Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords: forms, i18n',
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

from django import forms
from django.utils.translation import ugettext_lazy

class SearchForm(forms.Form):
  realm = forms.CharField(max_length = 100, required = True,
    widget = forms.TextInput(attrs = {' title': ugettext_lazy("lblSearchRealm") }))

If ugettext_lazy("lblSearchRealm") returns a value containing an umlaut, the "realm" fields is totally absent from the generated output for the page.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by bjornkri

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

Ran the code, both through shell and a rendered template, with and without fixing the space in ' title':, with lblSearchRealm set to "myfürm" in the appropriate mo/po, and I got the input field in every case.

Template:

{% load i18n %}
{{ form }}

And Shell:

print SearchForm()

Results in:

<tr><th><label for="id_realm">Realm:</label></th><td><input id="id_realm" type="text"  title="myfürm" name="realm" maxlength="100" /></td></tr>

Works for me.

comment:2 Changed 3 years ago by jacob

  • milestone 1.0 beta deleted

Milestone 1.0 beta deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.