我在 Django 的一个项目中工作,我刚刚开始尝试扩展用户模型,以便创建用户配置文件。
不幸的是,我遇到了一个问题: 每次我尝试在模板(例如 user.get_template.lastIP
)中获取用户的配置文件时,都会得到以下错误:
Environment: Request Method: GET Request URL: http://localhost:8000/ Django Version: 1.1 Python Version: 2.6.1 Template error: In template /path/to/base.tpl, error at line 19 Caught an exception while rendering: too many values to unpack 19 : Hello, {{user.username}} ({{ user.get_profile.rep}}). How's it goin? Logout Exception Type: TemplateSyntaxError at / Exception Value: Caught an exception while rendering: too many values to unpack
知道是怎么回事或者我做错了什么吗?