Exemple #1
0
 def __call__(self,request,*args,**kwargs):
     user = request.user
     excludes = dm.get_excludes(user)        
     if self.module in excludes:
         return HttpResponseRedirect(reverse('master_home_page'))
     self.widgets = filter(lambda x: x.__module__ + '.' + x.__name__ not in excludes and x.__module__ not in excludes, self.widgets)
     self.boxes = filter(lambda x:  x.__module__ + '.' + (x.__name__ if inspect.isclass(x) else x.__class__.__name__) not in excludes and x.__module__ not in excludes, self.boxes)        
     return self.view(request,*args,**kwargs)
Exemple #2
0
 def __init__(self, *args, **kwargs):
     excludes = dm.get_excludes(args[0].user)
     self.tabs = filter(lambda x: x.__module__ + '.' + x.__name__ not in excludes and x.__module__ not in excludes, self._tab_class)
     
     self.tabs = map(lambda x, i: x(user = getattr(self, 'user', args[0].user),
                         is_default = getattr(self, 'default_tab', i)==i,
                         tab_client = getattr(self, 'client', None)
                         ), self.tabs, range(len(self.tabs))
                     )
      
     self.context = {'tabs': [], 'id': self.widget_id, 'title' : self.title,'images': self._media.images}
     self.request = None