Django Admin\u get\u empty\u表单不推荐使用?

Django Admin\u get\u empty\u表单不推荐使用?,django,django-forms,django-admin,Django,Django Forms,Django Admin,我一直在使用找到的代码实现,它在我部署的服务器上的django admin中运行良好。服务器正在从较旧的django签出(7cfe8e8fce)运行。在本地计算机上,我正在运行当前签出(d407164c)。当尝试访问该表单时,我会得到下面的错误和对返回行的引用: def _get_empty_form(self, **kwargs): return super(ParentInstInlineFormSet, self)._get_empty_form(parent_instance=s

我一直在使用找到的代码实现,它在我部署的服务器上的
django admin
中运行良好。服务器正在从较旧的django签出(7cfe8e8fce)运行。在本地计算机上,我正在运行当前签出(d407164c)。当尝试访问该表单时,我会得到下面的错误和对
返回
行的引用:

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

\u从哪里得到空的表单
去了?最好的解决方法是什么?

\u get\u empty\u form
开头的
\u empty\u form
是一个很好的指标,表明您不应该依赖它的存在-它看起来像是为了使用
empty\u form
属性而被删除的


尝试修改代码以调用父类上的
empty\u form
属性。

我使用了
@property
装饰程序,而不是使用私有方法
\u get\u empty\u form

@property
def get_empty_form(self, **kwargs):
    if self.instance is not None:
        return super(ParentInstInlineFormSet, self).empty_form(parent_instance=self.instance)