Opened 13 years ago

Last modified 13 years ago

#17803 closed Bug

Field name with underscore means label not correctly shown in form — at Initial Version

Reported by: phoebebright@… Owned by: nobody
Component: Uncategorized Version: 1.3
Severity: Normal Keywords: form, label
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Is this a bug?

If I have this in my model:

account_type = models.CharField(_('Type of Business'), max_length=25, blank=True, null=True, help_text='What would your heading in a Directory be')

The in a model form the field name is "Account type" and there is no help text
If I change it to:

accounttype = models.CharField(_('Type of Business'), max_length=25, blank=True, null=True, help_text='What would your heading in a Directory be')

Form correctly has label of Type of Business and help text is displayed.

BUT it is not consistent,

This is the form:
class NameForm(forms.ModelForm):

class Meta:

model = Account
fields = ('name', 'contact_details','accounttype','turnover')

And this is another field with an underscore and it displays the label and help text correctly:

contact_details = models.TextField(_('Contact and Name'), blank=True, null=True, help_text='Actual Business Name and email/telephone if different from yours.')

I can dig some more if this might be a bug.....
Using current version 1.3.1 of django.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top