【发布时间】:2012-08-01 23:17:44
【问题描述】:
这是非常基本的,但我在上面找不到任何东西。我有一个按以下方式定义的用户配置文件:
def create_user_info(sender, instance, created, **kwargs):
if created:
UserInfo.objects.create(user=instance)
User.profile = property(lambda u: UserProfile.objects.get_or_create(user=u)[0])
现在如何设置属性?
【问题讨论】:
标签: python django python-2.x user-profile