Re: hiding the delete button

2009-09-30 Thread patcoll
Rajeesh, I forgot to thank you for the inspiration for the patch I submitted, so thanks! For future reference, it is also possible to disable the delete button by hard-coding the return value of "has_delete_permission" to False. An example from my code: class MenuAdmin(admin.ModelAdmin): #

Re: hiding the delete button

2009-09-30 Thread patcoll
I was able to come up with a patch to solve the issue. With my patch, by passing {'show_delete': False} in with extra_context in the ModelAdmin change_view method, the delete button/icon is no longer shown. http://code.djangoproject.com/ticket/10057 On Sep 30, 1:40 pm, rajeesh wrote: > Hi, > I

Re: hiding the delete button

2009-09-30 Thread rajeesh
Hi, I think the problem lies in ModelAdmin.render_change_form. Watch out the line of 'has_delete_permission' It reads as.. 'has_delete_permission': self.has_delete_permission(request, obj). It just don't know anything about the context variable 'show_delete'. Change the above line to .. 'has_de

hiding the delete button

2009-09-30 Thread patcoll
In the "admin/submit_line.html" template I can see options such as "show_delete_link", etc but cannot for the life of me figure out a programmatic way to set these values to False. Ideally, I would only like to display the "Save" button. (I realize I could override the "change_form" template for