1
私の理解によれば、事前入力フィールドにはforiegnkeyを含めるべきではありません。私は回避策を考えました。私のモデルであらかじめ入力したフィールドと関数()
..私はこれは私がそれをやっているか..です
def getname(self):
t1 = str(self.team_one)
t2 = str(self.team_two)
t1t2 = t1 + ' vs ' + t2
return t1t2
、私の管理者にそれを呼び出すの思想)(名前getNameが機能を定義しました。
prepopulated_fields = { 'name': ('getname()',)}
これは私の問題を解決するはずですが、これはdjangoの言葉です。
Exception Type: ImproperlyConfigured
Exception Value:
'FixtureAdmin.prepopulated_fields['name'][0]' refers to field 'getname' that is missing from model 'Fixture'.
解決方法はありますか
//マウス
何をしようとしていますか?たぶんjQueryを使って独自のカスタムJavScriptを書くことはできますか? –
私は2つのチームに基づいて灯具の名前を設定しようとしています。 – debuggerpk