2014-03-06 62 views
1

我正在試驗django。X是此函數的無效關鍵字參數

from import_export import resources 


class Settings1(models.Model): 
    foo = models.CharField(max_length=50) 


class Settings2(models.Model): 
    bar = models.CharField(max_length=20) 
    settings2 = models.OneToOneField(Settings1) 

當我試圖創建設置2對象實例它給了我這個錯誤

s2 = models.Settings2(bar='bar', settings2=settings) 

'settings2' is an invalid keyword argument for this function 
+0

你在哪裏創建這個實例? –

+0

Django shell cjcv – user1685095

回答

相關問題