开发者

Django admin - delete_selected problem

In admin.py file i paste:

admin.site.disable_action('delete_selected')

And get an error:

KeyError at /

'delete_selected'

Django Version: 1.3 Exception Type: KeyError Exception Value:

'delete_selected'

Exception Location: c:\Python27\lib\site-packages\django-1.3-py2.7.egg\django\contrib\admin\sites.py in disable_action, line 127

Any idea why it occurs? In my previous websites I haven开发者_JAVA技巧't that error and it is strange for me.


delete the admin.pyc file in your apps directory


This got rid of the issue for me. Just a quick test for 'delete_selected' before disabling the action.

if 'delete_selected' in admin.site.actions:
    admin.site.disable_action('delete_selected')

Cheers

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜