Opened 11 years ago
Last modified 11 years ago
#21653 closed Bug
help_text attribute into TextField model is not converted to the title attribute — at Version 1
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Forms | Version: | 1.6 |
Severity: | Normal | Keywords: | help_text, TextField |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
help_text
attribute into a TextField
model is not converted to the title attribute textarea into html-page!
I fixed this by using __init__
into MyModelForm
class MyModelForm(ModelForm): def __init__(self, *args, **kwargs): # filtered queryset in foreignkey choice field super(GenericModelForm, self).__init__(*args, **kwargs) for field in self.Meta.model._meta.fields: if field.get_internal_type() == "TextField": self.fields[field.name].widget.attrs['title'] = field.help_text
Django 1.6.1
Note:
See TracTickets
for help on using tickets.
I don't see why this is a bug -- could you explain?