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
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
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
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
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
5 matches
Mail list logo