1

I'm trying create a basic form which will allow the user to update their firstname, lastname and email as part of the User model. I've tried the following code:

from django.forms import ModelForm
from django.contrib.auth.models import User

class BasicAccountForm(ModelForm):
    class Meta:
        model = User
        fields = ('first_name', 'last_name', 'email')

It's throwing the following error:

Caught AttributeError while rendering: 'User' object has no attribute 'get'

Could anyone tell me what I am doing wrong, or if there is a better way to do what I am trying to accomplish?

1
  • Check if, you have something like user.get in your template. Exception points into that direction. Commented Jul 23, 2010 at 9:10

1 Answer 1

3

Figured this out, if anyone has the same problem, please see this link: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ModelFormsconstructornowmatchesForms

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.