def get_class_by_model_or_name(cls):
    collection_class = None
    if isinstance(cls, basestring):
        app_label, model_name = cls.split('.')
        try:
            collection_class=get_model(app_label, model_name)
        except __HOLE__:
            # This is a Django internal thing. If all the models are not yet loaded,
            # you can't get one out of the cache so it will try to do an import and then
            # you get circular dependencies. This just prepopulates the cache with all the models
            from django.db.models.loading import cache as app_cache
            app_cache._populate()
            # If it fails here you actually didn't specify a valid model class
            # remember it's "users.User" not just "User"
            collection_class=get_model(app_label, model_name)

    else:
        collection_class = cls
    return collection_class
dataset/ETHPy150Open jumoconnect/openjumo/jumodjango/etc/cache.py/get_class_by_model_or_name