Opened 11 years ago

Closed 11 years ago

#21653 closed Bug (invalid)

help_text attribute into TextField model is not converted to the title attribute

Reported by: a_mailbox@… 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 Tim Graham)

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

Change History (3)

comment:1 by Tim Graham, 11 years ago

Description: modified (diff)

I don't see why this is a bug -- could you explain?

comment:2 by a_mailbox@…, 11 years ago

I'm sorry... All right! :)

comment:3 by Marc Tamlyn, 11 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top