コード例 #1
0
ファイル: conf.py プロジェクト: CSIS-iLab/new-silk-road
 def _configure_serializer_doctype(self, serializer_class, index_name):
     doc_type_label = get_serializer_doctype_label(serializer_class)
     if doc_type_label:
         self._doctype_lookup[index_name].add(doc_type_label)
         # register doc_type_class with index
         doc_type_class = get_document_class(doc_type_label)
         doc_type_class._doc_type.index = index_name
     else:
         logger.error("DocType not found for '{}'".format(repr(serializer_class)))
コード例 #2
0
ファイル: conf.py プロジェクト: jnschrag/new-silk-road
 def _configure_serializer_doctype(self, serializer_class, index_name):
     doc_type_label = get_serializer_doctype_label(serializer_class)
     if doc_type_label:
         self._doctype_lookup[index_name].add(doc_type_label)
         # register doc_type_class with index
         doc_type_class = get_document_class(doc_type_label)
         doc_type_class._doc_type.index = index_name
     else:
         logger.error("DocType not found for '{}'".format(
             repr(serializer_class)))
コード例 #3
0
ファイル: test_utils.py プロジェクト: CSIS-iLab/new-silk-road
 def test_get_document_class_corrects_incomplete_path(self):
     klass = get_document_class('search.ProjectDoc')
     self.assertIsNotNone(klass)
     self.assertEqual(klass, ProjectDoc)
コード例 #4
0
ファイル: test_utils.py プロジェクト: CSIS-iLab/new-silk-road
 def test_get_document_class_gets_class_from_full_path(self):
     klass = get_document_class('search.documents.ProjectDoc')
     self.assertIsNotNone(klass)
     self.assertEqual(klass, ProjectDoc)
コード例 #5
0
ファイル: test_utils.py プロジェクト: CSIS-iLab/new-silk-road
 def test_get_document_class_raises_error_on_bad_path(self):
     with self.assertRaises(ImportError):
         get_document_class('foo.Bar')
コード例 #6
0
ファイル: test_utils.py プロジェクト: jnschrag/new-silk-road
 def test_get_document_class_raises_error_on_bad_path(self):
     with self.assertRaises(ImportError):
         get_document_class('foo.Bar')
コード例 #7
0
ファイル: test_utils.py プロジェクト: jnschrag/new-silk-road
 def test_get_document_class_corrects_incomplete_path(self):
     klass = get_document_class('search.ProjectDoc')
     self.assertIsNotNone(klass)
     self.assertEqual(klass, ProjectDoc)
コード例 #8
0
ファイル: test_utils.py プロジェクト: jnschrag/new-silk-road
 def test_get_document_class_gets_class_from_full_path(self):
     klass = get_document_class('search.documents.ProjectDoc')
     self.assertIsNotNone(klass)
     self.assertEqual(klass, ProjectDoc)