How to remove a field from the parent Form in a subclass?

You can alter the fields in a subclass by overriding the init method:

class LoginFormWithoutNickname(LoginForm):
    def __init__(self, *args, **kwargs):
        super(LoginFormWithoutNickname, self).__init__(*args, **kwargs)
        self.fields.pop('nickname')

Leave a Comment