I want to add an extra field to ModelForm. It seems easy, but I get the following error:
Django Version: 1.4 pre-alpha SVN-16573 Exception Type: TypeError Exception Value: argument of type 'NoneType' is not iterable Exception Location: /usr/local/lib/django-trunk/django/forms/models.py in construct_instance, line 39 Python Executable: /usr/bin/python Python Version: 2.6.6
This is the code:
class NodeForm(forms.ModelForm): password2 = forms.CharField(max_length=20, required=True, widget=forms.PasswordInput()) class Meta: model = Node def __init__(self, *args, **kwargs): super(NodeForm, self).__init__(*args, **kwargs)
I could not fix it. What am I doing wrong?
nemesisdesign
source share