I have a written views in django where i have more than one tab on the web page. Some of them I want to make invisible for those user whose is_staff status is False. Following is the code
TOP_NAVIGATION_BAR = [ {'name':'home', 'href':'/my_app/home',active:False},
{'name':'Content', 'href':'/my_app/content',active:False},
{'name':'Secure', 'href':'/my_app/Secure',active:False},
]
class topnavigationbar:
tab = TOP_NAVIGATION_BAR
def set_active_tab(self, tab_name):
for tab in self.tabs:
if tab['name'] == tab_name:
tab['active'] = True;
else:
tab['active'] = False;
def __init__(self, active_tab):
self.set_active_tab(active_tab)
For every view i set the top_navigation_bar active option= True.
Now I want that Secure tab should not be visible to users whose is_staff status is False. How and where can i write the query for that? Thanks