Ejemplo n.º 1
0
 def process_template_response(self, request, response):
     if hasattr(response, 'context_data') and response.context_data is not None: #TODO this shouldn't happen
         context = response.context_data
         if 'scopes' not in context:
             context['scopes'] = ScopeList([get_site_scope()])
             if 'object' in context and not any([scope.name == 'object' for scope in context['scopes']]):
                 context['scopes'].append(Scope(name='object', object=context['object']))
     return response
Ejemplo n.º 2
0
 def get_scopes(self):
     site_scope = get_site_scope()
     
     subsite_scope = Scope('subsite', object=self.subsite)
     subsite_scope.add_data('object', self.subsite, self.subsite.get_manage_urls())
     
     viewpoint_scope = Scope('viewpoint', object=self)
     viewpoint_scope.add_data('object', self, self.get_manage_urls())
     
     return ScopeList([site_scope, subsite_scope, viewpoint_scope])
Ejemplo n.º 3
0
    def get_scopes(self):
        site_scope = get_site_scope()

        subsite_scope = Scope('subsite', object=self.subsite)
        subsite_scope.add_data('object', self.subsite,
                               self.subsite.get_manage_urls())

        viewpoint_scope = Scope('viewpoint', object=self)
        viewpoint_scope.add_data('object', self, self.get_manage_urls())

        return ScopeList([site_scope, subsite_scope, viewpoint_scope])
Ejemplo n.º 4
0
 def process_template_response(self, request, response):
     if hasattr(
             response, 'context_data'
     ) and response.context_data is not None:  #TODO this shouldn't happen
         context = response.context_data
         if 'scopes' not in context:
             context['scopes'] = ScopeList([get_site_scope()])
             if 'object' in context and not any(
                 [scope.name == 'object' for scope in context['scopes']]):
                 context['scopes'].append(
                     Scope(name='object', object=context['object']))
     return response