Re: Generic templates

2010-02-01 Thread esatterwh...@wi.rr.com
I see what you are saying. your template would become somewhat complex and hard to maintain if you had a lot of permissions. However you can create whatever permissions you want in the meta class of your model and use those instead of the ACCESS_CHOICES and number checks class Meta: permission

Re: Generic templates

2010-01-31 Thread Dylan Evans
On Sun, Jan 31, 2010 at 11:46 PM, esatterwh...@wi.rr.com < esatterwh...@wi.rr.com> wrote: > if if you want to change the menu based on the user, you could > probably just use the user permissions from the auth context processor > > if the user has the permissions ( access ) to the option - show it

Re: Generic templates

2010-01-31 Thread esatterwh...@wi.rr.com
if if you want to change the menu based on the user, you could probably just use the user permissions from the auth context processor if the user has the permissions ( access ) to the option - show it else - don't show it. or if you want to use the model you have listed here, you could use the

Re: Generic templates

2010-01-30 Thread Dylan Evans
No i have processors, i have all the data i need in the template, i just don't know an elegant way to condition out menu items. This is how my model works ACCESS_CHOICES = ( (1, "Public"), (10, "Private"), (100, "Staff"), (1000, "System") ) class Menu(models.Model): name

Re: Generic templates

2010-01-30 Thread Shawn Milochik
I think you've missed context processors, which is easy to do. I'm assuming that your issue is that you want to have something passed in the context on every page load to do something like decide which menu items are available based upon whether the user is logged in, their privileges, or whatev