Django admin中的自定义视图:NoReverseMatch

时间:2012-05-31 22:35:10

标签: python django django-admin

我想在管理面板中为“添加”操作添加自定义视图。我写了下面的代码并得到了一个错误

 "NoReverseMatch Reverse for 'app_list' with arguments '()' 
 and keyword arguments '{'app_label': ''}' not found."

class UserDictionaryAdmin(BaseAdmin):
    list_display = ('word', 'user', 'word_state')

    class Meta:
        app_label = 'default'

    def add_view(self, request, form_url=None, extra_content=None):
        return render_to_response('admin/userdictionary_add.html', self.model._meta)

urls.py未被修改。

此外,我尝试了相同的结构而没有'self.model._meta',没有任何正面结果。

0 个答案:

没有答案