我一直在使用實現代碼here,它在我部署的服務器上工作正常,在django-admin
。服務器正在從一個較舊的django結賬(7cfe8e8fce)中運行。在我的本地機器上,我正在運行當前結帳(d407164c)。當試圖訪問的形式,我得到下面的錯誤,並給return
線的基準:Django Admin _get_empty_form棄用?
def _get_empty_form(self, **kwargs):
return super(ParentInstInlineFormSet, self)._get_empty_form(parent_instance=self.instance)
empty_form = property(_get_empty_form)
錯誤文本:
'super' object has no attribute '_get_empty_form'
Request Method: GET
Request URL: http://localhost:8000/pmc/admin/pmc_log/reportperiod/add/
Django Version: 1.6.dev20121220194515
Exception Type: AttributeError
Exception Value:
'super' object has no attribute '_get_empty_form'
Exception Location: /software/django-pmc-daily-log/src/pmc_log/pmc_log/forms.py in _get_empty_form, line 18
哪兒去_get_empty_form
?什麼是最好的解決辦法?