Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
I am moved to say thank you to all the devs from day 1 for Django. It is a marvellous piece of work. All of it. Thanks Mike On 30/03/2015 6:53 PM, Mike Dewhirst wrote: On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: snip That said, maybe I'm not getting your workflow correctly, but to me it seems that if request.user is not owner, some fields should be

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: On 29/03/2015 7:28 PM, Julo wrote: Maybe you can add an interface for the models that are importants and hook to the save/delete signal a interfaced function called CanSave() And you check the

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 2:06 AM, Ezequiel wrote: On Sunday, March 29, 2015 at 5:08:06 AM UTC-3, Mike Dewhirst wrote: A perhaps better solution would be to disable the Save and Delete widgets/actions in particular circumstances. How can I do something like this? The quick way I did this

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Melvyn Sopacua
On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: > On 29/03/2015 7:28 PM, Julo wrote: > > Maybe you can add an interface for the models that are importants > > and hook to the save/delete signal a interfaced function called > > CanSave() And you check the premisson he has, if not allowed rais

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Ezequiel
On Sunday, March 29, 2015 at 5:08:06 AM UTC-3, Mike Dewhirst wrote: > > A perhaps better solution would be to disable the Save and Delete > widgets/actions in particular circumstances. > > How can I do something like this? The quick way I did this was: In settings.py create a tuple

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 9:22 PM, Gabriel - Iulian Dumbrava wrote: In case you hide/not display the save/delete button you must also double check in the delete view if the current user has the right permissions to delete the item. It's pretty easy to add a post button in firebug, or even trigger the post

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 7:09 PM, Avraham Serour wrote: maybe overwrite the view in your own modeladmin class? I need to keep using the Admin and haven't done anything like that previously. I'll have to do the research. Thanks Mike On Sun, Mar 29, 2015 at 11:07 AM, Mike Dewhirst

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
r 2015 19:07:17 To: <django-users@googlegroups.com> Reply-To: django-users@googlegroups.com Subject: How to prevent save/delete in the Admin At the moment "has_change_permission" in the Admin works by returning 403 Forbidden if it gets a False. That doesn't suit my needs but it is

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Gabriel - Iulian Dumbrava
In case you hide/not display the save/delete button you must also double check in the delete view if the current user has the right permissions to delete the item. It's pretty easy to add a post button in firebug, or even trigger the post using a different method. duminică, 29 martie 2015,

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Julo
- From: Mike Dewhirst <mi...@dewhirst.com.au> Sender: django-users@googlegroups.com Date: Sun, 29 Mar 2015 19:07:17 To: <django-users@googlegroups.com> Reply-To: django-users@googlegroups.com Subject: How to prevent save/delete in the Admin At the moment "has_change_permission&qu

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Avraham Serour
maybe overwrite the view in your own modeladmin class? On Sun, Mar 29, 2015 at 11:07 AM, Mike Dewhirst wrote: > At the moment "has_change_permission" in the Admin works by returning > 403 Forbidden if it gets a False. > > That doesn't suit my needs but it is probably not

How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
At the moment "has_change_permission" in the Admin works by returning 403 Forbidden if it gets a False. That doesn't suit my needs but it is probably not advisable to adjust it. Users without change permission need to be able to see the data and perhaps raise an exception (in this case