我想在管理面板中为“添加”操作添加自定义视图。我写了以下代码并得到了一个错误
"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'
没有任何积极的结果。