我是通过django
这样做的$ python manage.py shell
from django.contrib.auth.models import User
a = User(username='zoro')
a.get_profile().?
我在get_profile
后输入什么内容。获取完整的个人资料,而不是输入一个像
a.get_profile().Location
获取该位置。
答案 0 :(得分:1)
a.get_profile()
是完整的配置文件(它是用户配置文件模型的实例对象)。因此,您可以将其保存在变量中并使用它。
虽然如果你想把一切都当成python dict,你可以试试a.get_profile().__dict__
。