def update_index(self, which_indexing): #setup new indexing if 'new' in which_indexing: indexing.update_index_properties(self) # setup old indexing if 'old' in which_indexing: prefix.update_prefix_properties(self)
def test_update_prefix_properties(self): prefix.add_prefix_properties(TestPerson, 'name') test_person = TestPerson(name='John') prefix.update_prefix_properties(test_person) assert test_person.name_n_ == 'JOHN' assert test_person.name_n1_ == 'J' assert test_person.name_n2_ == 'JO'
def test_update_prefix_properties(self): prefix.add_prefix_properties(TestPerson, 'name') test_person = TestPerson(name='John') prefix.update_prefix_properties(test_person) self.assertEqual(getattr(test_person, 'name_n_'), 'JOHN') self.assertEqual(getattr(test_person, 'name_n1_'), 'J') self.assertEqual(getattr(test_person, 'name_n2_'), 'JO')
def update_index(self, which_indexing): #setup new indexing if 'new' in which_indexing: indexing.update_index_properties(self) if config.get('enable_fulltext_search'): full_text_search.add_record_to_index(self) # setup old indexing if 'old' in which_indexing: prefix.update_prefix_properties(self)
def update_index(self, which_indexing): #setup new indexing if 'new' in which_indexing: indexing.update_index_properties(self) # setup old indexing if 'old' in which_indexing: prefix.update_prefix_properties(self) # index for full text search self.index()