Re: Template composition: Rendering based on permissions

2010-04-28 Thread Nick
The bible for user authentication is found here http://docs.djangoproject.com/en/1.1/topics/auth/ The quick answer to number 2 is to check for authentication in a template tag: {% if user.is_authenticated %} Welcome back you rotten jerk {% else %} Log in, you rotten jerk {% endif %} On Apr 28, 2

Re: Template composition: Rendering based on permissions

2010-04-28 Thread Thomas Allen
I think that template context processors are the answer to my first question. As for my second question, I could certainly check for permission membership in the provided PermWrapper, but I'm very interested in a way to check this based on the view permission requirement (implicitly). Thomas --

Template composition: Rendering based on permissions

2010-04-28 Thread Thomas Allen
Hi everyone, I have two questions about rendering specific design elements, and the second ties in somewhat with the first. How do you make a variable available in multiple views (multiple templates)? For instance, maybe I want the active user object to be available on each page so that I can ren