Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 156179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:17:10+00:00 2026-05-11T10:17:10+00:00

I have a form that inherits from 2 other forms. In my form, I

  • 0

I have a form that inherits from 2 other forms. In my form, I want to change the label of a field that was defined in one of the parent forms. Does anyone know how this can be done?

I’m trying to do it in my __init__, but it throws an error saying that ”RegistrationFormTOS’ object has no attribute ’email”. Does anyone know how I can do this?

Thanks.

Here is my form code:

from django import forms from django.utils.translation import ugettext_lazy as _ from registration.forms import RegistrationFormUniqueEmail from registration.forms import RegistrationFormTermsOfService  attrs_dict = { 'class': 'required' }  class RegistrationFormTOS(RegistrationFormUniqueEmail, RegistrationFormTermsOfService):     '''     Subclass of ``RegistrationForm`` which adds a required checkbox     for agreeing to a site's Terms of Service.      '''     email2 = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, maxlength=75)), label=_(u'verify email address'))      def __init__(self, *args, **kwargs):         self.email.label = 'New Email Label'         super(RegistrationFormTOS, self).__init__(*args, **kwargs)      def clean_email2(self):         '''         Verifiy that the values entered into the two email fields         match.          '''         if 'email' in self.cleaned_data and 'email2' in self.cleaned_data:             if self.cleaned_data['email'] != self.cleaned_data['email2']:                 raise forms.ValidationError(_(u'You must type the same email each time'))         return self.cleaned_data 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:17:11+00:00Added an answer on May 11, 2026 at 10:17 am

    You should use:

    def __init__(self, *args, **kwargs):     super(RegistrationFormTOS, self).__init__(*args, **kwargs)     self.fields['email'].label = 'New Email Label' 

    Note first you should use the super call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Putting the the using statement inside the namespace makes it… May 11, 2026 at 12:36 pm
  • added an answer You can create an Application Lock to protect your flag,… May 11, 2026 at 12:36 pm
  • added an answer Well, if after setting the DataContext, you did an Invoke… May 11, 2026 at 12:36 pm

Related Questions

I have a form that contains a GridView control which is databound to an
I have a form that I would like to style. specifcally I would like
I have a form that searches all rows in a single table (TServices) that
I have a form that is sending in sizes of things, and I need
I have a form that has multiple fields, and for testing purposes is there
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
I have a base User Control. I place Ok and Cancel buttons on the
I have an ASP.NET GridView which has columns that look like this: | Foo
I want to have a abstract view for any type of UI (web or
I have a base form. I place Ok and Cancel buttons on the bottom

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.