开发者

Creating a user profile form in Django 1.2

I'm trying create a basic form whic开发者_如何学编程h 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜