Search - User list
Full Version: disable "delete_selected" admin action only for DjangoBB models
Root » Bugs » disable "delete_selected" admin action only for DjangoBB models
1
jedie
I notice that admin.site.disable_action('delete_selected') would disable the action for all models.

I changed the admin.py file to disable the action only for DjangoBB models: https://github.com/slav0nic/DjangoBB/pull/8

btw. why is this really needed? The comment says:
# disabled, because delete_selected ignoring delete model method

So model_instance.delete() would not be called? maybe http://stackoverflow.com/questions/1471909/django-model-delete-not-triggered would help?
slav0nic
it will be veeeeeryyy sloooow
deleting 100 objects ~= 100 delete operation + 100 select + 100 update + overhead from python

maybe on_delete action can help with action (but not with perfomance)

i don't played with new on_delete FK params in django 1.4 + for this django 1.3 support must be dropped
jedie
The boring thing is, that you can't select a few post in the admin and delete it via actions.

In which scenario do you delete hundreds of post in a bulk?
slav0nic
jedie
./manage.py shell

ok, i will check is on_drop called via action
XRumerTest
Hello. And Bye.
XRumerTest
Hello. And Bye.
XRumerTest
Hello. And Bye.
XRumerTest
Hello. And Bye.
XRumerTest
Hello. And Bye.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB