in modeladmin - show a field to edit only if superuser

2009-10-13 Thread Sergio A.
I'd like to show for editing the 'owner' field only to superuser; I'm using django 1.0: class ProductAdmin(admin.ModelAdmin): form = ProductForm fieldsets = [ ('Product Identification', {'fields': ['owner', 'code', ...), ('Product Description', {'fields': ['...]

how to get back to a view requiring login

2009-10-11 Thread Sergio A.
I've three views each with different URL. They are visible to logged in users. If a non-logged user tries to access a URL requiring login, I'm able to redirect it to the login page. What I'm missing is how to go back to the initial page, once the user log in the system. Cheers, Sergio --~--~---

Re: in admin interface - how to edit/show data based on ownership/not ownership

2009-06-14 Thread Sergio A.
I found where to work on. The render_change_form function in the options.py file where the render_change_form is invoked. All the information seem to be available in that context. Sergio On Jun 14, 2:42 pm, "Sergio A." wrote: > I need to identify where to overwrite the template s

Re: in admin interface - how to edit/show data based on ownership/not ownership

2009-06-14 Thread Sergio A.
d/c84d... > Not exactly what you want but might give you some ideas. > > On Jun 11, 7:36 pm, "Sergio A." wrote: > > > Hello, > > > in this blog post: > > >http://www.b-list.org/weblog/2008/dec/24/admin/ > > > it is explained how to list

in admin interface - how to edit/show data based on ownership/not ownership

2009-06-11 Thread Sergio A.
Hello, in this blog post: http://www.b-list.org/weblog/2008/dec/24/admin/ it is explained how to list only data that someone owns and restrict edit permission. What I'd like to do is to list all the data, but let users change only those owned, while showing the rest for reading. This means tha

Re: select template for adminform based on type of user

2009-06-02 Thread Sergio A.
any hint on this issue? Thanks, Sergio On May 29, 12:51 am, "Sergio A." wrote: > Dear all, > > Is it possible to select the template to be applied to an admin form > based on the logged user? > In particular, I've two cases: > > - if super user, a certain

select template for adminform based on type of user

2009-05-28 Thread Sergio A.
Dear all, Is it possible to select the template to be applied to an admin form based on the logged user? In particular, I've two cases: - if super user, a certain template should be used - if not a super user, but the owner of the data, then another template should be used - if not a super user,

Re: has_add_permission() isn't working properly

2009-05-17 Thread Sergio A.
t 5:34 PM, Sergio A. > > wrote: > > >> the issue seems not to be totally solved by the patch. > > >> If I have two classes A and B > >> class A has a field being a foreign key to a B class field > >> in the admin, when I add an A element, I see the &#

Re: has_add_permission() isn't working properly

2009-05-17 Thread Sergio A.
the issue seems not to be totally solved by the patch. If I have two classes A and B class A has a field being a foreign key to a B class field in the admin, when I add an A element, I see the '+' button on the foreign key field to B even though I do not have the rights to create a B element. Th