Пример #1
0
 def register_model(self, model):
     """
     Register new model class
     """
     self.models[get_path(model)] = model
     if model.__name__ not in self.name_to_path:
         self.name_to_path[model.__name__] = []
     self.name_to_path[model.__name__].append(get_path(model))
Пример #2
0
 def register_model(self, model):
     """
     Register new model class
     """
     self.models[get_path(model)] = model
     if model.__name__ not in self.name_to_path:
         self.name_to_path[model.__name__] = []
     self.name_to_path[model.__name__].append(get_path(model))
Пример #3
0
 def test_get_path(self):
     self.assertEqual("__builtin__.unicode", utils.get_path(unicode))
     self.assertEqual("tests.utils.UtilsTest", utils.get_path(UtilsTest))