Beispiel #1
0
 def _mode_columns(self, mode):
     # request-relevant roles to determine displayabe fields in this mode
     request_context_roles = common.get_request_context_roles(None)
     return [
         field for field in self.__class__.fields
         if field.is_displayable(mode, request_context_roles)
     ]
Beispiel #2
0
 def handle_search(self, action, data):
     self.show_results = True
     user_roles = (
         common.get_request_context_roles(self.request) +
         common.get_workspace_roles() + ["bungeni.Anonymous"])
     data["role"] = list(set(user_roles))
     data["page"] = self.request.form.get("page", 1)
     self.search_results = execute_search(data, self.prefix, 
         self.request, self.context)
     self.status = _("Searched for '${search_string}' and found ${count} "
         "items. Searched in ${search_types}.", 
         mapping={ 
             "search_string": data.get("search") or _("everything"), 
             "count": self.search_results.get("total"),
             "search_types": get_search_types(data.get("type")),
         }
     )
 def _mode_columns(cls, mode):
     # request-relevant roles to determine displayabe fields in this mode
     request_context_roles = common.get_request_context_roles(None)
     return [ field for field in cls.fields 
         if field.is_displayable(mode, request_context_roles) ]