我们可以在 Form 的“元类”部分定义多个模型吗?
这是我的例子:
from django import forms
from django.contrib.auth.models import User , Group
from django.forms import ModelForm
from django.utils.translation import ugettext as _
from profiles.models import Student , Tutor
class RegistrationForm(ModelForm):
email = forms.EmailField(label=_('Email Address:'))
password = form.CharField(label=_('Passsword:') , widget = forms.PasswordInput(render_value = False))
password1 = form.CharField(label=_('Verify Passsword:') , widget = forms.PasswordInput(render_value = False))
class Meta:
model = [Student , Tutor] ## IS THIS TRUE ???