Issue
I have a form that I use to register users. I have another form that I use to login users. These two forms share common properties such as the username and password.
I tried to create a LoginForm that inherits from RegisterForm but I don't know how to remove fields I don't need for login, such as repeat password or the agree to T&Cs checkbox.
How can I do this? These forms inherit from Form not ModelForm.
Solution
If LoginForm
is truly a subset of RegisterForm
, you're probably better off reversing your inheritance.
class LoginForm(Form):
username = ...
password = ...
class ReigsterForm(LoginForm):
confirm_password = ...
Answered By - dirn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.