Example #1
0
 def dispatch(self, request, *args, **kwargs):
     set_id_mapping(self.id_mapping)
     set_doc_view(self.doc_view)
     set_desc_view(self.desc_view)
     set_resource_registry(self.resource_registry)
     try:
         return super(MappingView, self).dispatch(request, *args, **kwargs)
     finally:
         set_id_mapping(None)
         set_doc_view(None)
         set_desc_view(None)
         set_resource_registry(None)
Example #2
0
 def f(*args, **kwargs):
     mappingconf.set_desc_view(('data', 'desc'))
     mappingconf.set_doc_view(('data', 'doc-generic'))
     mappingconf.set_id_mapping(TEST_ID_MAPPING)
     mappingconf.set_resource_registry(resource.base_resource_registry)
     try:
         return func(*args, **kwargs)
     finally:
         mappingconf.set_desc_view(None)
         mappingconf.set_doc_view(None)
         mappingconf.set_id_mapping(None)
         mappingconf.set_resource_registry(None)