2016-02-05 25 views

回答

0

最簡單的方法是store additional data在關於用戶的UserProfile模型中,例如,

from django.contrib.auth.models import User 

class UserProfile(models.Model): 
    # This field is required. 
    user = models.OneToOneField(User) 

    # Other fields here 
    where_heard_about_us = models.TextField() 

然後,您可以註冊對象作爲嵌入對象在你的Django管理

+0

我想你的建議,並在管理員要登記時,得到了下面的錯誤。沒有這樣的列:accounts_registration.where_heard_about_us –

+0

你做了syncdb/migrate嗎? – mragh

+0

是的,但仍然沒有運氣 –

相關問題