#30164: Changing attributes in the default Authentication Form
-------------------------------------+-------------------------------------
Reporter: Oskar | Owner: nobody
Haller |
Type: Bug | Status: new
Component: | Version: 2.1
Uncategorized |
Severity: Normal | Keywords: Authentication Form
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The following code works
{{{
class LoginForm(AuthenticationForm):
"""
adds helptext to authentication
"""
def __init__(self, *args, **kwargs):
super(LoginForm, self).__init__(*args, **kwargs)
self.fields['username'].help_text = _("Enter your E-Mail address")
self.fields['password'].help_text = _("Enter your password")
}}}
However, from this documentation
[https://docs.djangoproject.com/en/2.1/topics/forms/modelforms
/#modelforms-overriding-default-fields] I would have guessed that I could
simply specify those elements with a MetaClass. But that did not work.
Is that a bug or just something I'm not aware of?
--
Ticket URL: <https://code.djangoproject.com/ticket/30164>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/047.9e64561ef523f4c8d44667ea24e25eb8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.