                  new_class._default_manager = new_class._default_manager._copy_to_model(new_class)
                  new_class._base_manager = new_class._base_manager._copy_to_model(new_class)
  
          # Bail out early if we have already created this class.
          m = get_model(new_class._meta.app_label, name, False)
          if m is not None:
              return m
  
          # Add all attributes to the class.
          for obj_name, obj in attrs.items():
 
</s> remove         return get_model(new_class._meta.app_label, name, False)
 </s> add         return get_model(new_class._meta.app_label, name,
                         seed_cache=False, only_installed=False) </s> remove     model = get_model(app_label, model_name, False)
 </s> add     model = get_model(app_label, model_name,
                      seed_cache=False, only_installed=False)
        m = get_model(new_class._meta.app_label, name,
                      seed_cache=False, only_installed=False)
                  new_class._default_manager = new_class._default_manager._copy_to_model(new_class)
                  new_class._base_manager = new_class._base_manager._copy_to_model(new_class)
  
          # Bail out early if we have already created this class.
        m = get_model(new_class._meta.app_label, name,
                      seed_cache=False, only_installed=False)
          if m is not None:
              return m
  
          # Add all attributes to the class.
          for obj_name, obj in attrs.items():
keep keep keep keep replace keep keep keep keep keep
 Fixed #15866, #15850 -- Prevented get_model() and get_models() from returning not-installed models (by default). Thanks adsva for report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16053 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/db/models/base.py