class LoginForm(forms.Form):
nickname = forms.CharField(max_length=100)
username = forms.CharField(max_length=100)
password = forms.CharField(widget=forms.PasswordInput)
class LoginFormWithoutNickname(LoginForm):
# i don't want the field nickname here
nickname = None #??
Is there a way to achieve this?
注意:我没有ModelForm
分,所以Meta
和exclude
分不起作用.