def _get_installed_models(table_list):
 from django.db import models
 all_models = []
 for app in models.get_apps():
  for model in models.get_models(app):
   all_models.append(model)
 return set([m for m in all_models if (m._meta.db_table in table_list)])

def _get_installed_models ( table_list ) : from django . db import models all_models = [ ] for app in models . get_apps ( ) : for model in models . get_models ( app ) : all_models . append ( model ) return set ( [ m for m in all_models if ( m . _meta . db_table in table_list ) ] )
gets a set of all models that are installed .