#7018: Make ModelForm multiple inheritance is possible.
---------------------------------------------+------------------------------
          Reporter:  bear330                 |         Owner:  nobody
            Status:  new                     |     Milestone:        
         Component:  Forms                   |       Version:  SVN   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  0     
        Needs_docs:  0                       |   Needs_tests:  0     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by Wernight):

 It may be nice to have also `Form` and `ModelForm` multiple inheritance
 support. Once case I can think of is having the a user profile `ModelForm`
 couple with the Auth `UserCreationForm`. Illustated below:

 {{{
 class UserProfile(models.Model):
     # This is requred fields for AUTH_PROFILE_MODULE
     user = models.ForeignKey(User, unique=True)

     # User profile information
     age = models.PositiveSmallIntegerField(_("Age"))
     gender = models.CharField(_("Gender"), max_length=1, choices=(
         ('M', _('Male')),
         ('F', _('Female')),
     ))

 class MyRegistrationForm(UserCreationForm, forms.ModelForm):
     class Meta:
         model = UserProfile
 }}}

 Given that Django provides a good support '''user profiles''', it may be a
 good idea to support those profiles' creation in an easy way for fields
 that a project see as being required for all its users.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7018#comment:7>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to